Lewati ke konten utama

Pasang SDK

Pilih SDK untuk runtime Anda. Masing-masing mengirim peristiwa ke endpoint ingest yang sama dan mengevaluasi feature flag secara lokal dari aturan yang sama, sehingga pengguna masuk ke rollout yang sama mana pun yang Anda pilih.

Kunci dalam cuplikan ini berasal dari konsol: Dapatkan kunci API

At a glance

Packages
@prodantix/sdk (web), prodantix_sdk (Dart), prodantix_sdk_flutter (Flutter), prodantix-sdk (Python)
Credential
The public project key: Projects & keys
Endpoints
Hosts and contracts: REST

Peramban dan Node

Bash
bun add @prodantix/sdk

# Aplikasi React juga memakai adaptornya:
bun add @prodantix/react
JavaScript
import { createWebClient } from '@prodantix/sdk/web';

const prodantix = createWebClient({
  apiKey: PRODANTIX_PUBLIC_KEY,
  host: 'https://eu.api.prodantix.com',
  flagsHost: 'https://api.prodantix.com',
});

prodantix.capture('order.completed', { properties: { amount: 4200 } });
JavaScript
import { ProdantixProvider, useProdantix } from '@prodantix/react';

<ProdantixProvider options={{ apiKey: PRODANTIX_PUBLIC_KEY, host: 'https://eu.api.prodantix.com' }}>
  <App />
</ProdantixProvider>

const prodantix = useProdantix();
prodantix?.capture('order.completed');

Flutter dan Dart

Bash
flutter pub add prodantix_sdk_flutter

# Server Dart atau CLI, tanpa lapisan Flutter:
dart pub add prodantix_sdk

Server Python

Bash
pip install prodantix-sdk

Kunci proyek Anda bersifat publik: ia menamai proyek, bukan memberi akses ke datanya, jadi tempatnya di kode klien. Kunci server, yang bisa menulis, tidak pernah.

Ke mana selanjutnya

Mulai cepat: capture a first event and read it back. Each package’s full surface is under Packages, and framework wiring (React, Vue, Svelte, Angular) under Frameworks.