# Client libraries

Client libraries enable easy access to drand randomness in specific programming languages. They also provide peace of mind by verifying randomness rounds and add additional features like failover, racing, aggregation, and caching.

drand randomness is available over HTTP and over libp2p PubSub.

Currently, the following client libraries are available:

If your application cannot use the libraries above, you can still make requests to the HTTP API endpoints. If you have created a client library or know of a client library not listed here, please let us know by opening an issue (opens new window).

# Go

# Install

go get github.com/drand/drand/v2@latest

# Usage

The Go drand client library is structured with a base client interface in /client, and with protocol-specific transport implementations in /client/http, /client/grpc and /lp2p/client. The main client package holds transport agnostic logic for retrying, validation, and caching.

For documentation and examples please check the Go clients reference:

Client implementations (to be used with the above):

# JS

# Install

In the browser or Deno (opens new window) you can grab and use the client from a CDN e.g. https://cdn.jsdelivr.net/npm/drand-client/drand.js (opens new window).

In Node.js (opens new window), install with:

npm install drand-client

# Usage

The JS drand client is an esmodule. It has no dependencies and is not transpiled. It can be imported directly in the browser, Deno or Node.js. In Node.js it can be imported from CommonJS using await import('...').