Configuration

Configure the SDK for your environment

Basic Configuration

const sdk = new MybeSDK({
  apiKey: 'your-api-key'
});

The SDK automatically detects your environment and uses the appropriate API endpoint.

Environment Detection

Development (NODE_ENV=development)

http://localhost:3001/api/v1

Production

https://api.mybe.app/api/v1

Custom Base URL

You can override the default base URL if needed:

const sdk = new MybeSDK({
  apiKey: 'your-api-key',
  baseUrl: 'https://custom-api.example.com/api/v1'
});

Environment Variables

Store your API key in environment variables:

MYBE_API_KEY=your-api-key

Then use it in your code:

const sdk = new MybeSDK({ apiKey: process.env.MYBE_API_KEY });