Labelbox Custom Interface SDK
An SDK for the Labelbox API.
See the Labelbox Custom Interface Documentation for more information.
Installation
You can either load the SDK through an HTML script
tag or install the npm package.
Option 1: script
Tag
Add a script
tag with the SDK's URL on unpkg in your interface's HTML:
<script src="https://unpkg.com/@labelbox/labeling-api"></script>
This will add Labelbox
as a globally-accessible variable.
Option 2: npm Package
- Install the package through the npm CLI:
npm install @labelbox/labeling-api;
- In your code,
import
or require
the package (depending on your environment):
import Labelbox from '@labelbox/labeling-api';
const Labelbox = require('@labelbox/labeling-api');
Usage
See the Labelbox Custom Interface Documentation for usage instructions and an API reference.
Local Development
To build the package locally, run yarn build
.
Publishing
Production API serves the package version that has the latest
npm dist-tag. Never run npm publish
directly. The tagging scheme for labeling-api is as follows:
latest
: Production build. This will be served by api.labelbox.com & installed when a customer installs via npm install @labelbox/labeling-api
next
: Staging build. This will be served by staging-api.labelbox.com. This will be served by your local api server by default.dev
: Local builds only. Will never be served from production or staging.
Production
To update the labeling-api build for production run yarn publish:prod
. This should be done when a when a commit that changes this package hits the master
branch.
Staging
To update the build for staging run yarn publish:next
. This should be done when a commit that changes this package hits the develop
branch.
Development
To test out development builds publish to dev
channel via, yarn publish:dev
. You will need to update LABELING_API_VERSION
env var of your local api server to serve this channel.