Skip to content

stanza-js contains the Node.js and Browser SDK for Stanza, along with JavaScript samples.

License

Notifications You must be signed in to change notification settings

StanzaSystems/stanza-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stanza JS

This is the monorepo containing all Stanza JavaScript packages and samples.

Documentation

Refer to the README.md file linked to each sample, and the Stanza Docs.

Sample Applications

The following samples are used primarily during Stanza development, and are works in progress:

  • samples/browser-simple - Browser sample app using a mocked hub
  • samples/hub-mock-api - Express sample app using a mocked hub

Stanza Packages

Main Packages

  • packages/core - Stanza JS core library, used by browser, node, and other packages
  • packages/browser - Stanza browser SDK
  • packages/mobile - Stanza mobile SDK
  • packages/sdk-node - Stanza Node SDK
  • packages/sdk-cloudflare - Stanza Cloudflare SDK

Supporting Packages

  • packages/next - Stanza components for Next.js
  • packages/next-node - Stanza Node SDK adapter for Next.js
  • packages/stanza-react - Stanza React components
  • packages/stanza-rn - Stanza React Native components
  • packages/mocks - Stanza mocks for use in development and testing

Toolchain

Stanza JS uses the following tools, which you should familiarize yourself with:

Throughout this document, we'll assume that Nx is not installed globally and use npx nx. If you prefer to install Nx globally, you can use nx instead of npx nx anywhere that it is mentioned.

Getting started

Install all dependencies for the monorepo:

npm install

If you get deprecation or vulnerability warnings, they are likely from our development dependencies only, and unrelated to Stanza packages. To be certain, you can run npm audit --omit=dev which should find 0 vulnerabilities. If this is not the case, please open an issue.

After everything is installed, you can build all of the packages and sample applications:

npx nx run-many --target build

If you prefer, you can build a single sample application, including its dependent packages. For example:

From the repository root:

npx nx build express-demo

Or, from a specific directory:

cd samples/express-demo
npx nx build

Running a sample

Running a sample application is similar to building, but uses the serve target:

From the repository root:

npx nx serve express-demo

Or, from a specific directory:

cd samples/express-demo
npx nx serve

By default, these samples will run in development mode. Saving a file will restart the application.

Workspaces and packages

To add a new package:

npx nx generate @nx/js:library {your package name} --publishable --importPath @getstanza/{your package name}

To add a sample app, you can use one of the available Nx packages as a starter template.

Some examples:

npx nx generate @nx/next:app {your app name}
npx nx generate @nx/web:app {your app name}
npx nx generate @nx/react:app {your app name}

Because we manage the repository as a monorepo with Nx, all dependencies should be installed from the root directory.

Support

Stanza supports only evergreen browsers, and Node releases in current, active, or maintenance phases.

About

stanza-js contains the Node.js and Browser SDK for Stanza, along with JavaScript samples.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published