Authentication
Credentials
Section titled “Credentials”The SDK requires three credentials from your Bigship.in account:
| Credential | Description |
|---|---|
userName |
Your Bigship login email |
password |
Your Bigship password |
accessKey |
API access key from Bigship dashboard |
Creating a Client
Section titled “Creating a Client”import { BigshipClient } from '@agamya/bigship-sdk';
const client = new BigshipClient({ baseURL: 'https://api.bigship.in', userName: process.env.BIGSHIP_USER_NAME!, password: process.env.BIGSHIP_PASSWORD!, accessKey: process.env.BIGSHIP_ACCESS_KEY!,});Token Management
Section titled “Token Management”The SDK handles authentication automatically:
- First request — SDK calls the Bigship login endpoint to obtain a token
- Token caching — Token is cached for 55 minutes (configurable via
tokenTtlMs) - Concurrent requests — If multiple requests fire simultaneously, only one login call is made
- Token expiry — When the token expires, the SDK automatically refreshes it
You never need to manage tokens manually.
Configuration Options
Section titled “Configuration Options”const client = new BigshipClient({ // Required baseURL: 'https://api.bigship.in', userName: 'your-email@example.com', password: 'your-password', accessKey: 'your-access-key',
// Token management tokenTtlMs: 55 * 60 * 1000, // Default: 55 minutes});Security
Section titled “Security”- Server-side only — The SDK is designed for Node.js and server-side runtimes
- Never expose credentials — Do not use the SDK in browser/client-side code
- Use environment variables — Never hardcode credentials in source code
- Next.js — Use Route Handlers or Server Actions, never
"use client"components