Setup
Svix offers a REST API to interact with the service, and easy to use libraries to interact with the API.
Svix also has an API reference and OpenAPI (formerly Swagger) specifications at the API documentation page which you can always refer to the exact schemas and endpoints available in our API.
When working with Svix you can either use our REST API directly, or using any of our libraries. In this document we'll cover how to install them for each platform.
Install the libraries
- JavaScript
- Python
- Rust
- Go
- Java
- Kotlin
- Ruby
- C#
- CLI
- cURL
npm install svix
// Or
yarn add svix
pip install svix
go get github.com/svix/svix-webhooks/go
svix = "0"
Gradle: Add this dependency to your project's build file:
implementation "com.svix:svix:0.x.y"
Maven: Add this dependency to your project's POM:
<dependency>
<groupId>com.svix</groupId>
<artifactId>svix</artifactId>
<version>0.x.y</version>
</dependency>
Gradle: Add this dependency to your project's build file:
implementation "com.svix.kotlin:svix-kotlin:0.x.y"
Maven: Add this dependency to your project's POM:
<dependency>
<groupId>com.svix.kotlin</groupId>
<artifactId>svix-kotlin</artifactId>
<version>0.x.y</version>
</dependency>
gem install svix
dotnet add package Svix
On macOS install via Homebrew:
brew install svix/svix/svix
On Windows install via Scoop:
scoop bucket add svix https://github.com/svix/scoop-svix.git
scoop install svix
For other platforms, such as linux, checkout the CLI docs on Github.
# Install cURL. E.g. on arch linux:
pacman -S curl
# Or on macOS
brew install curl
Then you can just use them as follows
- JavaScript
- Python
- Rust
- Go
- Java
- Kotlin
- Ruby
- C#
- CLI
- cURL
import { Svix } from "svix";
const svix = new Svix("AUTH_TOKEN");
const app = await svix.application.create({ name: "Application name" });
from svix.api import Svix, SvixAsync, ApplicationIn
svix = Svix("AUTH_TOKEN")
app = svix.application.create(ApplicationIn(name="Application name"))
# Or use the async variants
svix = SvixAsync("AUTH_TOKEN")
app = await svix.application.create(ApplicationIn(name="Application name"))
import (
svix "github.com/svix/svix-webhooks/go"
)
svixClient := svix.New("AUTH_TOKEN", nil)
app, err := svixClient.Application.Create(&svix.ApplicationIn{
Name: "Application name",
})}
use svix::api::{ApplicationIn, Svix, SvixOptions};
let svix = Svix::new("AUTH_TOKEN".to_string(), None);
let app = svix.application().create(ApplicationIn {
name: "Application name".to_string(),
..ApplicationIn::default()
}).await?;
import com.svix.models.ApplicationIn;
import com.svix.models.ApplicationOut;
import com.svix.Svix;
Svix svix = new Svix("AUTH_TOKEN");
ApplicationOut app = svix.getApplication().create(new ApplicationIn().name("Application name"));
import com.svix.kotlin.models.ApplicationIn;
import com.svix.kotlin.Svix;
val svix = Svix("AUTH_TOKEN")
val applicationOut = svix.application.create(ApplicationIn(name = "Application name"))
require "svix"
svix = Svix::Client.new("AUTH_TOKEN")
application_out = svix.application.create(Svix::ApplicationIn.new({
"name" => "Application name"}))
using Svix;
using Svix.Model;
using Svix.Models;
var svix = new SvixClient("sk_IrlFPEh3VYctuyHhKTCxamGV", new SvixOptions("https://api.svix.com"));
await svix.Application.CreateAsync(new ApplicationIn(name: "Application name"));
export SVIX_AUTH_TOKEN="AUTH_TOKEN"
svix application create '{ "name": "Application name" }'