Skip to content

epilot-dev/sdk-js

Repository files navigation

epilot-logo
epilot-sdk

CI npm version License

⚠️ DISCLAIMER!

The epilot SDK is in beta. Missing features, incomplete documentation and breaking API changes are to be expected!

Quick Start

npm install --save epilot-sdk
import { authorizeWithToken } from 'epilot-sdk/auth'; import entityClient from 'epilot-sdk/entity-client'; // authorize client using an access token authorizeWithToken(entityClient, '<my_access_token>'); // use epilot client await entityClient.createEntity('contact', { first_name: 'Example', last_name: 'Contact' });

Documentation

Updating clients (epilot internal)

To update a client package with a new API definition, you should have made the changes already on the current API repo.

⚠️ Never modify a client openapi.json directly, such approach will most certainly lead to you losing your changes on a future release.

## navigate into you client folder cd clients/entity-client ## update openapi.json with the new API spec (if already deployed to prod) npm run openapi ## shortcut: if the desired openapi spec is still deploying, but will be in prod soon. npm run openapi <path/to/local/openapi.yml> ## build and generate new types npm run typegen && npm run build ## commit your changes git commit -am 'chore(entity-client): update client with new spec'

Publishing packages (epilot internal)

This monorepo uses Changesets for version management and publishing.

Creating a changeset for a single package

# Create a changeset (interactive prompt) pnpm changeset # Apply version bumps pnpm version-packages # Publish to npm (requires 2FA) pnpm publish-packages

Publishing all client packages with a version bump

To bump and publish all client packages at once:

# 1. Create a changeset file manually or use the changeset command # Example: .changeset/minor-bump-all-clients.md with all client packages listed # 2. Apply version bumps to all packages pnpm version-packages # 3. Publish all updated packages (requires 2FA authentication) pnpm publish-packages # NOTE: you may need to run this multiple times due to NPM rate limiting

Manual changeset creation

For bulk updates, create a file in .changeset/ directory:

--- "@epilot/entity-client": minor "@epilot/file-client": patch --- Description of changes

Available scripts

  • pnpm changeset - Create a new changeset
  • pnpm version-packages - Apply version bumps based on changesets
  • pnpm publish-packages - Publish updated packages to npm

Contributing

The epilot Javascript SDK is free and open source software. PRs welcome!

🚀