Installing Pro
Not yet published. No Pro package has been released and nothing is for sale yet; the registry holds a test package only. This page describes the setup the release is built for.
@vectorstream/pro is not on the public npm registry. It lives on a private npm registry (GitLab package registry) that also
passes the free @vectorstream/* packages through from npm. You point the scope @vectorstream at that registry; a scope
can belong to one registry only, and this is why the free packages come through it.
The registry#
You get a read-only registry token after you buy a license. Put this into the .npmrc of your project (or of your build machine):
@vectorstream:registry=https://gitlab.com/api/v4/projects/88419753/packages/npm/
//gitlab.com/api/v4/projects/88419753/packages/npm/:_authToken=${VECTORSTREAM_REGISTRY_TOKEN}
The token is read from the environment variable VECTORSTREAM_REGISTRY_TOKEN. Do not write the token into the file, do not
commit it, and do not put it into a client bundle. In CI, set it as a secret or protected environment variable. The token
only gives access to the packages; it is not the license key, which the page needs at run time.
Then install:
npm install @vectorstream/pro
Install the free packages the same way if you do not have them yet (npm install @vectorstream/editor @vectorstream/core @vectorstream/adapter);
they come from npm through the same registry.
If your access ends (the subscription is cancelled or the token expires), the registry answers 401 to new installations. Code you
have installed already keeps working.
Pro names @vectorstream/editor, @vectorstream/core and @vectorstream/adapter as peer dependencies, in the range of
the version it was tested with. Install the same versions of the free packages that Pro asks for. The package comes as
ES modules with type declarations.
Plugging Pro in#
There are two ways, and they do the same:
- For every editor built afterwards:
import '@vectorstream/pro/global'. The import has a side effect on purpose. Make sure your bundler keeps it; the package declares this file as its side effect. - For one editor:
new Editor(…, adapter, { erweiterungen: [proErweiterung()] }), withproErweiterungfrom@vectorstream/pro.
The list of violations is a separate entry, @vectorstream/pro/ui, see The list of violations. Give
Pro its license key as described in Setting up the license key.
Without Pro the free editor is unchanged. The cut between the two is described in Free and Pro.