Core SDK
Core Module & Authentication
Learn how to initialize the Oxinion SDK and authenticate your requests safely.
Core Module
Build with confidence
The Oxinion SDK Core module is the foundation of the SDK. it handles authentication, client initialization, and provides common communication utilities used by all other modules.
Getting Your API Keys
1
Sign up for an Oxinion SDK account
Create your business account in the console
2
Navigate to API Keys
Find the API Keys section in your dashboard
3
Generate an API Key
Get your API key — it starts with oxk_live_
SDK Initialization
Core initialization
All modules require an initialized Core client to handle authentication and communication.
typescript
1import { createOxinion } from 'oxinion';
2
3// Initialize the SDK with your API key
4const oxinion = createOxinion({
5 apiKey: process.env.OXINION_API_KEY!, // oxk_live_...
6});
7
8// All subsequent calls through this instance are authenticated
9const { geofences } = await oxinion.geofencing.list();
Security Notice: Never expose API keys in client-side code, public repositories, or unsecured environments. Always use environment variables for key storage.
Core Client Methods
oxinion.track()
Send a location event to the Oxinion engine. Oxinion evaluates the event against your defined geofences and triggers actions.
typescript
1await oxinion.track({
2 type: 'enter', // 'enter' | 'exit' | 'dwell'
3 lat: 43.6532,
4 lng: -79.3832,
5 userId: 'user_123', // optional
6});
oxinion.geofencing
Create and list geofences. See the Geofencing docs for full details.
typescript
1// List all geofences
2const { geofences } = await oxinion.geofencing.list();
3
4// Create a geofence
5const { geofence } = await oxinion.geofencing.create({
6 name: 'My Store',
7 lat: 43.6532,
8 lng: -79.3832,
9 radius: 150,
10 triggerType: 'enter',
11});
Rate Limiting
Oxinion SDK implements rate limiting to ensure fair usage across all users.
Standard Plan
1,000
requests per minute
Pro Plan
5,000
requests per minute
Enterprise Plan
Custom
requests per minute
Security Best Practices
Never expose API keys in client-side code
Use environment variables for key storage
Rotate API keys regularly
Monitor API usage and set up alerts
