Skip to content

Connecting with an SDK

Each SDK’s client speaks gRPC to an EvidentSource server. Pointing one at the Sandbox is a matter of the address.

  • gRPC: https://sandbox.evidentsource.com:50051
  • No authentication is required on the public Sandbox.

Keep the https://. The Sandbox serves gRPC over TLS, and every SDK chooses TLS from the address’s scheme: an address without https:// connects in plaintext, and fails against the Sandbox. Use http://localhost:50051 for a server on your machine.

use evidentsource_client::EvidentSource;
let es = EvidentSource::connect_to_server("https://sandbox.evidentsource.com:50051").await?;

The crate is evidentsource-client.

import client "github.com/evidentsystems/evidentsource-sdks/go/packages/evidentsource-client"
es, err := client.ConnectSimple(ctx, "https://sandbox.evidentsource.com:50051")
import { EvidentSource } from "@evidentsource/client";
const es = EvidentSource.connect("https://sandbox.evidentsource.com:50051");
from evidentsource_client import EvidentSource
es = await EvidentSource.connect("https://sandbox.evidentsource.com:50051")

The package is evidentsource-client.

using EvidentSource.Client;
var es = await EvidentSourceClient.ConnectAsync("https://sandbox.evidentsource.com:50051");

A client opens a connection to each database it uses. From a connection you run State Changes, and read State Views and events.

In Rust, TypeScript and .NET, a connection follows the database’s revision as it advances, resubscribing after an error. In Go, Subscribe follows it until its stream ends; SubscriptionErr() then says why, and you subscribe again unless it is ErrSubscriptionsUnsupported. A Python connection doesn’t follow it: ask it for the latest database when you need a current revision. A server whose storage backend can’t push updates refuses to be followed, and keeps refusing while it runs. The connection then stops trying and says so: live_updates_unsupported() in Rust, liveUpdatesUnsupported in TypeScript, LiveUpdatesUnsupported in .NET, and ErrSubscriptionsUnsupported in Go. Its cached revision then stays where it was, and in Rust and TypeScript fetching the latest database doesn’t move it, so a State Change it runs is decided at that revision.

The same clients connect to your own servers: change the address, and send a bearer token. See Security.