Skip to content

Examples

Working examples are available in the sdk-examples directory of the Shiplight examples repository.

Getting Started

1. Clone the Examples Repository

bash
git clone https://github.com/ShiplightAI/examples.git
cd examples/sdk-examples

2. Install Dependencies

bash
npm install
npx playwright install chromium

3. Configure Environment

bash
cp .env.example .env

Edit .env with your keys:

bash
# Use the key matching the model in the example, or a Shiplight proxy token
GOOGLE_API_KEY=your-google-api-key
# ANTHROPIC_API_KEY=your-anthropic-api-key
# OPENAI_API_KEY=your-openai-api-key
# SHIPLIGHT_API_TOKEN=your-shiplight-api-token

4. Run Examples

bash
npm run quickstart

Available Examples

ExampleDescriptionRun
quickStart.tsBasic SDK usage - login, assert, extractnpm run quickstart
basicUsage.tsCore features - act, assert, evaluate, extractnpm run basic
loginExample.tsSmart login with 2FA supportnpm run login
selfHealingExample.tsSelf-healing with step()npm run self-healing
customActions.tsExtend agent with custom actionsnpm run custom-actions
variablesExample.tsVariable managementnpm run variables
fileOperationsExample.tsFile uploadnpm run file-upload
extractionExample.tsData extraction patternsnpm run extraction

Test Site

Login and commerce examples use the Sauce Labs demo site (public):

  • Username: standard_user
  • Password: secret_sauce

Other examples also use public pages such as example.com, Wikipedia, and a public file-upload test page. They make live LLM calls and access external sites, so results depend on provider and site availability.

Released under the MIT License.