Quick Start
Get Syntropy running in your application in under 5 minutes.
1. Create a Project
- Sign up at syntropy.chat
- Create an organization
- Create a new project
- Copy your Project ID (this is your DSN)
2. Install the SDK
Choose the SDK for your platform:
# Browser / React / Vue / Vanilla JS
npm install @eclosion-tech/syntropy-browser
# Node.js backend
npm install @eclosion-tech/syntropy-node
# React Native / Expo
npm install @eclosion-tech/syntropy-react-native
# Next.js (includes both client and server)
npm install @eclosion-tech/syntropy-nextjs
# Express.js
npm install @eclosion-tech/syntropy-express
3. Initialize the SDK
Browser
// src/index.ts or main entry point
import { Syntropy } from '@eclosion-tech/syntropy-browser';
Syntropy.init({
projectId: 'your-project-id',
release: '1.0.0',
environment: process.env.NODE_ENV,
});
React Native / Expo
// App.tsx - at the very top, before other imports
import { Syntropy } from '@eclosion-tech/syntropy-react-native';
import * as Application from 'expo-application';
import * as Updates from 'expo-updates';
Syntropy.init({
projectId: 'your-project-id',
release: Application.nativeApplicationVersion ?? '1.0.0',
dist: Application.nativeBuildVersion ?? undefined,
environment: __DEV__ ? 'development' : 'production',
updateId: Updates.updateId ?? undefined,
updateChannel: Updates.channel ?? undefined,
});
Node.js
// At the very start of your app
import { Syntropy } from '@eclosion-tech/syntropy-node';
Syntropy.init({
projectId: 'your-project-id',
release: process.env.npm_package_version,
environment: process.env.NODE_ENV,
});
Next.js
// instrumentation.ts (Next.js 13+)
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
const { Syntropy } = await import('@eclosion-tech/syntropy-nextjs');
Syntropy.init({
projectId: 'your-project-id',
release: process.env.npm_package_version,
});
}
}
Express
import express from 'express';
import {
Syntropy,
syntropyMiddleware,
syntropyErrorHandler,
} from '@eclosion-tech/syntropy-express';
Syntropy.init({
projectId: 'your-project-id',
});
const app = express();
// Request handler must be first
app.use(syntropyMiddleware());
// Your routes
app.get('/', (req, res) => res.send('Hello'));
// Error handler must be last
app.use(syntropyErrorHandler());
3.5. Call Management APIs (Optional)
Use the typed SDK API client when you want to manage source maps, chat schemas, and customers:
import { createSyntropyApiClient } from '@eclosion-tech/syntropy-node';
const api = createSyntropyApiClient({
baseUrl: 'https://syntropy.chat/api',
apiKey: process.env.SYNTROPY_API_KEY,
});
await api.customers.upsert(
{ organizationId: 'org_uuid', projectId: 'project_uuid' },
{ externalId: 'user_123', email: 'user@example.com' }
);
4. Verify It Works
Trigger a test error:
// Browser
Syntropy.captureError(new Error('Test error from Syntropy setup'));
// Or throw an unhandled error
throw new Error('Unhandled test error');
Check your Syntropy dashboard - you should see the error appear within seconds.
Next Steps
- Error Capture - Manual error capture
- Breadcrumbs - Track user actions
- Release Tracking - Track versions
- User Identification - Link errors to users