Getting started with Stream Sync Engage is quick and easy. Choose the installation method that works best for your project.
Package Manager Installation
npm
npm install @streamsyncengage/client
yarn
yarn add @streamsyncengage/client
pnpm
pnpm add @streamsyncengage/client
CDN Installation
For quick prototyping or simple projects, you can include Stream Sync Engage directly from a CDN:
<script src="https://unpkg.com/@streamsyncengage/client@latest/dist/sse.min.js"></script>
Module Import
ES6 Modules
import { SSEClient } from '@streamsyncengage/client';
CommonJS
const { SSEClient } = require('@streamsyncengage/client');
UMD (Browser)
<script src="https://unpkg.com/@streamsyncengage/client@latest/dist/sse.umd.js"></script>
<script>
const { SSEClient } = window.StreamSyncEngage;
</script>
Development Setup
Prerequisites
- Node.js 16.0 or higher
- npm 7.0 or higher (or equivalent yarn/pnpm version)
- WebSocket support in your target environment
Create a New Project
# Create project directory
mkdir my-sse-app
cd my-sse-app
# Initialize package.json
npm init -y
# Install Stream Sync Engage
npm install @streamsyncengage/client
# Install development dependencies
npm install --save-dev typescript @types/node
Project Structure
my-sse-app/
├── src/
│ ├── client.ts
│ ├── handlers/
│ └── index.ts
├── package.json
└── tsconfig.json
TypeScript Support
Stream Sync Engage includes full TypeScript support out of the box:
npm install @streamsyncengage/client
npm install --save-dev typescript @types/node
Create a tsconfig.json
:
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "node",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2020", "DOM"]
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
Verification
Create a simple test to verify your installation:
// src/index.ts
import { SSEClient } from '@streamsyncengage/client';
const client = new SSEClient({
endpoint: 'wss://sse.yourdomain.com',
token: 'your-auth-token'
});
// Listen for notifications
client.on('notification', (event) => {
console.log('Received notification:', event.message);
});
// Listen for functional events
client.on('functional', (event) => {
if (event.type === 'feature-toggle') {
console.log(`Feature ${event.featureName} is now ${event.enabled ? 'enabled' : 'disabled'}`);
}
});
// Connect
client.connect()
.then(() => console.log('Connected to SSE!'))
.catch(err => console.error('Connection failed:', err));
What’s Next?
Now that you have Stream Sync Engage installed, you’re ready to start building:
- Quick Start Guide - Build your first integration
- Real-Time Pipeline - Learn the fundamentals
- Client API Reference - Explore the complete API
Troubleshooting
Common Issues
Module not found errors:
- Ensure you’ve installed SSE:
npm list @streamsyncengage/client
- Check your import paths are correct
TypeScript errors:
- Ensure TypeScript is installed:
npm install --save-dev typescript
- Update your
tsconfig.json
configuration
Connection failures:
- Verify your WebSocket endpoint is accessible
- Check your authentication token is valid
- Ensure your firewall allows WebSocket connections
Build failures:
- Ensure Node.js version is 16.0 or higher:
node --version
- Clear your package cache:
npm cache clean --force
Need more help? Contact our support team or check the community forums.