Library
Introduction

Mockingbird library

Mockingbird can be used as a library inside any application.

Installation

The library is available from npm (opens in a new tab).

You can install it using npm install @tinybirdco/mockingbird

Basic Usage

It's simple to embed Mockingbird into an application.

The most basic usage is to import one of the generators, initialize it and call generate.

import {
  presetSchemas,
  TinybirdGenerator,
  generate,
} from "@tinybirdco/mockingbird";
 
const schema = presetSchemas["Simple Example"];
 
const tbGenerator = new TinybirdGenerator({
  schema,
  endpoint: "gcp_europe_west3",
  datasource: "test",
  token: "e.pXXXX",
  eps: 100,
  limit: -1,
});
 
await tbGenerator.generate();

If you are embedding Mockingbird inside a web page in a user's browser, we strongly recommend to call the generate() method inside a Web Worker (opens in a new tab). The Mockingbird UI takes this approach, so you can use this as a reference implementation (opens in a new tab).