Skip to content

samsarone/api-demo

Repository files navigation

Samsar text logo

Samsar-js API examples

Theme Mode Routes

Minimal, interactive examples for testing the Samsar APIs with real request/response flows.

Quick Start

  1. Open a terminal in this folder:
    cd /Users/pritamroy/Documents/others/workspace/samsar_one/examples
  2. Install dependencies:
    npm install
  3. Copy the env template:
    cp .env.example .env
  4. (Optional) Add your key in .env:
    API_KEY=your_real_key_here
  5. Start the app:
    npm run dev
  6. Open: http://localhost:3067

How To Get Your API Key

  1. Sign in at app.samsar.one.
  2. Go to your account settings.
  3. Open the API keys section.
  4. Create a new key and copy it.
  5. Paste it into .env as API_KEY=....

If you open the app without adding a key in the toolbar, it loads in read-only sample mode so you can browse the UI.

How To Test Routes In The UI

  1. Use the top toolbar and pick an API route from the endpoint dropdown.
  2. Choose a product (if the route supports product context).
  3. Paste your API key in the top toolbar and click Use key to enable live mode.
  4. Switch between:
    • Admin view (request/workflow side)
    • Storefront view (customer-facing simulation)
  5. Click the run action in the toolbar to execute the route.
  6. Open the JSON panel to inspect request and response.

For video and long-running routes, the page will show progress and update when the job is complete.

Routes Included (Custom Implementations)

Category Route
Chat chat-enhance
Chat chat-search-against-embedding
Chat chat-similar-to-embedding
Image image-enhance
Image image-add-image-set
Image image-remove-branding
Video video-text-to-video
Video video-image-list-to-video
Video video-translate
Video video-join

Friendly Troubleshooting

  • You see a read-only toolbar notice: add your API key in the top toolbar and click Use key.
  • Request fails with auth error: key is invalid or expired.
  • Route takes time: some video/image routes are async and need polling time.
  • Want to return to sample mode: clear the API key from the toolbar.

About

Example for API usage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages