> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stigg.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Backend

Stigg provides backend SDKs and APIs that allow you to manage customers, subscriptions, entitlements, and usage reporting from your server-side application.

> [!NOTE]
>
> For the Sidecar SDK (gRPC-based, optimized for low-latency entitlement checks), see the dedicated [Sidecar SDK](https://docs.stigg.io/api-and-sdks/integration/backend/sidecar.md) page.

## Authentication

All backend SDKs authenticate using the **Full access key**, which can be found in the Stigg app under [Integrations > API keys](https://app.stigg.io/account/settings).

> [!WARNING]
>
> The Full access key should only be used in server-side applications and should never be exposed in client-side code.

## Installing the SDK

```shell Node.js theme={null}
npm install @stigg/node-server-sdk
```

```shell Python theme={null}
pip install stigg-api-client-v2
```

```shell Go theme={null}
go get github.com/stiggio/api-client-go/v7
```

```shell Ruby theme={null}
bundle add stigg-api-client
```

```groovy Java theme={null}
// Gradle (build.gradle)
dependencies {
  implementation 'io.stigg:stigg-api-client:+'
  implementation 'com.apollographql.apollo3:apollo-runtime:3.8.2'
  implementation 'com.apollographql.apollo3:apollo-api-jvm:3.8.2'
  implementation 'com.apollographql.apollo3:apollo-adapters-jvm:3.8.2'
}

repositories {
  mavenCentral()
}

// Maven (pom.xml)
<dependencies>
	<dependency>
		<groupId>io.stigg</groupId>
		<artifactId>stigg-api-client</artifactId>
		<version>LATEST</version>
	</dependency>
	<dependency>
		<groupId>com.apollographql.apollo3</groupId>
		<artifactId>apollo-runtime</artifactId>
		<version>3.8.2</version>
	</dependency>
	<dependency>
		<groupId>com.apollographql.apollo3</groupId>
		<artifactId>apollo-api-jvm</artifactId>
		<version>3.8.2</version>
	</dependency>
	<dependency>
		<groupId>com.apollographql.apollo3</groupId>
		<artifactId>apollo-adapters-jvm</artifactId>
		<version>3.8.2</version>
	</dependency>
</dependencies>
```

```shell .NET theme={null}
dotnet add package Stigg.Api.Client
```

## SDK initialization

All SDKs are initialized with the Full access key. The SDK instance should be initialized once per process (singleton pattern) and reused throughout your application, as it maintains an internal cache and supports retries.

```javascript Node.js theme={null}
import { Stigg } from '@stigg/node-server-sdk';

const stiggClient = Stigg.initialize({ apiKey: 'YOUR_FULL_ACCESS_KEY' });

export default stiggClient;
```

```python Python theme={null}
from stigg import Stigg

client = Stigg.create_client("STIGG_FULL_ACCESS_KEY")
```

```go Go theme={null}
import (
  "context"
  "github.com/stiggio/api-client-go/v7"
  "os"
)

func Ptr[T any](v T) *T {
  return &v
}

func main() {
  apiKey := os.Getenv("STIGG_FULL_ACCESS_KEY")
  client := stigg.NewStiggClient(apiKey)
}
```

```ruby Ruby theme={null}
require("stigg")

api_key = ENV["STIGG_FULL_ACCESS_KEY"]
client = Stigg.create_client(api_key)
```

```java Java theme={null}
import io.stigg.api.client.Stigg;

class App {
    public static void main(String[] ...args) {
        var stigg = Stigg.createClient("<FULL-ACCESS-KEY>");
    }
}
```

```c# .NET theme={null}
using Stigg.Api.Client;

class App {
    public static void main() {
        var stigg = Stigg.createClient("<FULL-ACCESS-KEY>");
    }
}
```

## Operations

> [card] [Customer management](https://docs.stigg.io/api-and-sdks/integration/backend/customers.md)
>
> Provision, update, retrieve, and archive customers

> [card] [Subscription management](https://docs.stigg.io/api-and-sdks/integration/backend/subscriptions.md)
>
> Provision, update, cancel, list, and migrate subscriptions

> [card] [Entitlement checks](https://docs.stigg.io/api-and-sdks/integration/backend/entitlements.md)
>
> Check feature access and retrieve entitlements

> [card] [Usage, billing & credits](https://docs.stigg.io/api-and-sdks/integration/backend/usage-and-billing.md)
>
> Report usage, estimate costs, manage credits and promotions

## Products

Retrieve all products configured in Stigg, including display names, descriptions, metadata, and downgrade plan information.

```javascript Node.js theme={null}
const products = await stiggClient.getProducts();
```

```c# .NET theme={null}
var resp = await stigg.GetProducts.ExecuteAsync();
```

## Real-time updates

The **Node.js Server SDK** supports a streaming connection to receive real-time updates with low latency when customer entitlements or usage change.

Available events:

* **Entitlements updated** - fired when a customer's entitlements change
* **Usage updated** - fired when a customer's usage is updated

```javascript Node.js theme={null}
// listen to customer entitlement updates
stiggClient.addListener('entitlementsUpdated', (data) => {
  console.log('entitlements updated: ', data.customerId, data.entitlements);
});

// listen to customer usage updates
stiggClient.addListener('usageUpdated', (data) => {
  console.log('entitlement usage updated', data.entitlement, data.usage);
});
```

## Advanced features

### Persistent caching

Configure a persistent cache (Redis) to survive restarts and share cache across multiple instances.

> [card] [Persistent caching](https://docs.stigg.io/documentation/high-availability-and-scale/persistent-caching.md)

### Offline mode

The **Node.js Server SDK** supports offline mode for local development and testing, avoiding network requests to the Stigg API. In offline mode, entitlement evaluations use fallback values.

The **Sidecar SDK (Java)** supports an offline/air-gapped mode for environments with restricted network access, enabling in-memory entitlement evaluation without connecting to a Sidecar process.

### Sidecar service

The Sidecar service provides low-latency entitlement checks, handles caching, and subscribes to real-time entitlement and usage data updates. It can be deployed as a sidecar container or a standalone service.

> [card] [Sidecar service](https://docs.stigg.io/documentation/high-availability-and-scale/sidecar/overview.md)

## SDK references

> [card] [Node.js SDK](https://node-sdk-docs.stigg.io/classes/stigg)
>
> Full reference for the Node.js Server SDK

> [card] [Python SDK](https://python-sdk-docs.stigg.io/stigg.client.StiggClient)
>
> Full reference for the Python API client

> [card] [Go SDK](https://pkg.go.dev/github.com/stiggio/api-client-go/v7)
>
> Full reference for the Go API client

> [card] [GraphQL API](https://studio.apollographql.com/public/Stigg-API/variant/Production/explorer)
>
> Interactive GraphQL API playground

## SDK changelogs

> [card] [Node.js](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/node.md)
>
> Node.js SDK changelog

> [card] [Python](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/python.md)
>
> Python SDK changelog

> [card] [Ruby](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/ruby.md)
>
> Ruby SDK changelog

> [card] [Go](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/go.md)
>
> Go SDK changelog

> [card] [Java](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/java.md)
>
> Java SDK changelog

> [card] [.NET](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/dotnet.md)
>
> .NET SDK changelog

> [card] [Sidecar](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/sidecar.md)
>
> Sidecar SDK changelog


## Related topics

- [Backend](https://docs.stigg.io/api-and-sdks/references/sdk/backend/rest/index.md)
- [Multiple active subscriptions](https://docs.stigg.io/documentation/managing-customers-and-subscriptions/subscriptions/multiple-active-subscriptions.md)
- [Allow customers to have multiple subscriptions to the same product](https://docs.stigg.io/guides/i-want-to/add-multiple-subscriptions.md)
- [API Keys](https://docs.stigg.io/documentation/managing-your-account/environments/api-keys.md)
- [Hardening client-side access](https://docs.stigg.io/api-and-sdks/integration/frontend/hardening-client-side-access.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.