Configuration
Set Up Your Environment Variables
To authenticate with Synodes, you need an API key. You can obtain an API key from the Synodes platform.
- Navigate to the Synodes Dashboard.
- Go to API Keys.
- Click the
Create Keybutton. - Add your API key to your
.envfile by setting theSYNODES_API_KEYenvironment variable. - Define the Synodes API URL in your
.envfile by setting theSYNODES_API_URLenvironment variable.
Configuration Options
Synodes SDK provides an option to configure settings using the SynodesConfig class in Python and TypeScript. The SynodesConfig class accepts the following parameters:
api_key: Your Synodes API keyapi_url: URL of your Synodes APItarget: Synodes Target to create the Sandboxes on.
from synodes import SynodesConfig
config = SynodesConfig( api_key="your-api-key", api_url="your-api-url", target="us")import { SynodesConfig } from '@synodesio/sdk';
const config: SynodesConfig = { apiKey: "your-api-key", apiUrl: "your-api-url", target: "us"};Environment Variables
Synodes SDK supports environment variables for configuration. The SDK automatically looks for these environment variables:
| Variable | Description | Optional |
|---|---|---|
SYNODES_API_KEY | Your Synodes API key. | |
SYNODES_API_URL | URL of your Synodes API. | Yes |
SYNODES_TARGET | Synodes Target to create the Sandboxes on. | Yes |
Setting Environment Variables
Synodes SDK can read configuration from environment variables. You can set these environment variables using the following methods:
Using a .env File
Create a .env file in your project root directory:
SYNODES_API_KEY=your-api-keySYNODES_API_URL=https://your-api-urlSYNODES_TARGET=usSYNODES_API_KEY: Your Synodes API key.SYNODES_API_URL: URL of your Synodes API.SYNODES_TARGET: Synodes Target to create the Sandboxes on.
Using Shell Environment
Set environment variables in your shell:
export SYNODES_API_KEY=your-api-keyexport SYNODES_API_URL=https://your-api-url$env:SYNODES_API_KEY="your-api-key"$env:SYNODES_API_URL="https://your-api-url"Configuration Precedence
The SDK uses the following precedence order for configuration (highest to lowest):
- Explicitly passed configuration in code.
- Environment variables.
- Configuration file.
- Default values.