Quick start
Getting started
Getting started with Exoquic is easy, but there are some prerequisites.
Prerequisites
- Github account and an organization.
- A backend application for authorizing subscriptions and publishing events.
Publishing events from your backend
- Installation
npm i @exoquic/pub
- Publish your first event
import ExoquicPublisher from "@exoquic/pub"
const publisher = new ExoquicPublisher({ apiKey: MY_API_KEY });
publisher.publish({
topic: "my-topic" // Automatically created if it doesn't exist
payload: "This is my first event published with Exoquic!"
});
Learn more about publishing events
Subscribing to a topic from your frontend
- Setup an endpoint on your backend to authorize subscribers. Exoquic requires you to setup an endpoint on your backend that will be responsible for authorizing subscribers. It is of course up to you to decide what users should access what topics/channels. In the example below, we only have the topic, my-topic, that is accessible to everyone.
npm i @exoquic/auth
const express = require("express");
const exoquicAuth = require("@exoquic/auth");
// Initialize the subscription authorizer with your API key
exoquicAuth.initalizeSubscriptionAuthorizer(MY_API_KEY);
const app = express();
app.get("/my-authorize-subscribers-endpoint", async (req, res) => {
// Fetch an authorization token from Exoquic,
// authorizing the subscriber to subscribe to the topic 'my-topic'.
const authorizedSubscription = await exoquicAuth.authorizeSubscription({
topic: "my-topic"
});
// Return the authorization token to the subscriber
return res.text(authorizedSubscription);
});
- Subscribing to a topic from your frontend
npm i @exoquic/sub
import { SubscriptionManager } from "@exoquic/sub"
const subscriptionManager = new SubscriptionManager(async () => {
// This is the endpoint we setup in step 1, returns an authorization token
return await fetch("/my-authorize-subscribers-endpoint");
});
// Retrieves an authorization token which authorizes the subscriber
// to subscribe to the topic 'my-topic'.
const subscriber = await subscriptionManager.authorizeSubscriber();
subscriber.subscribe(message => {
console.log(message); // Do whatever you want with the event
});
Check out the API documentation
Learn about ExoQuic's subscription options, authorization, and channel-specific subscriptions in the documentation.
Learn more about consuming events
Publish events
Learn more about publishing events from your backend to Exoquic.
Receive events
Learn more about receiving events from Exoquic on your client-side application.
Why use Exoquic?
Simplify Developer Workflows. Our event-streaming platform removes the complexity of managing simultaneous events, allowing developers to focus on building features instead of dealing with concurrency, synchronization, locking, load balancing, data consistency and more. This not only results in faster, more reliable applications with fewer errors but also accelerates feature implementation, reducing both development time and costs.
Lower Costs. Save on development, infrastructure, maintenance and network costs by reducing the need for complex code and dedicated infrastructure. Our fully managed solution eliminates hardware, infrastructure, and personnel costs, reducing expenses by up to 90%. By enabling our caching layer on the client side, you can also reduce your egress costs by up to 90%.
Focus on Core Business. Spend more time on unique features and services for your business, without worrying about maintaining complex, real-time streaming infrastructure.
Enhanced User Experience. Deliver a smoother, real-time experience with zero delays, allowing users to interact seamlessly without interruptions.
Massive Scalability. Our platform scales effortlessly with your business growth, handling increased loads without slowing down or crashing. Our pricing is designed to scale alongside you, ensuring cost-efficiency as your needs evolve.
Getting help
Whether you’re troubleshooting or looking to optimize your setup, we're here to help.
Submit an issue
Report issues directly in our GitHub repository. Our support team and community are here to assist.
Join the community
Engage with other developers, share ideas, and find support in our growing community.