Installation
Learn how to install and configure the SDK in your project.
Quick Start
Create a new project with our SDK:
Terminal
❯
yarn create next-app@latest my-app --yes
❯
cd my-app
❯
yarn dev
Add to Existing Project
Install the SDK using your preferred package manager:
Terminal
❯
yarn add our-sdk
Requirements
Make sure you have Node.js 18 or higher installed on your system.
- Node.js: 18.x or higher
- TypeScript: 5.x or higher (optional, but recommended)
TypeScript Setup
If you're using TypeScript, the SDK comes with built-in type definitions. No additional packages are required.
tsconfig.json
{
"compilerOptions": {
"target": ES2020,
"module": ESNext,
"moduleResolution": bundler,
"strict": true
}
}
Configuration
Create a configuration file in your project root:
sdk.config.js
export default {
apiKey: process.env.SDK_API_KEY,
environment: "production",
options: {
timeout: 5000,
retries: 3,
},
};
Available Scripts
After installation, you can use these npm scripts in your project:
package.json
{
"scripts": {
"dev": next dev,
"build": next build,
"start": next start,
"lint": eslint,
lint:fix: eslint --fix
}
}
Never commit your API keys to version control. Always use environment variables.
Environment Variables
Set up your environment variables:
Terminal
Verification
Verify your installation by running:
Terminal
❯
node -e "console.log(require('our-sdk').version)"
You should see the SDK version printed to the console.
Next Steps
Now that you have the SDK installed, check out the Quick Start guide to begin using it.