@inialum/token-generator
v0.2.0
Published
CLI tool to generate token
Downloads
300
Readme
@inialum/token-generator
CLI tool to generate a token for INIALUM services.
Usage
Install the package:
pnpm add -D @inialum/token-generator
Or if you prefer to run it directly without installing it:
pnpm dlx @inialum/token-generator -- <options>
Create a
.env
file in the root of your project:TOKEN_SECRET=<secret>
You can create random secret value for
TOKEN_SECRET
with the following command:openssl rand -base64 32
Add the following script to your
package.json
:{ "scripts": { "generate-token": "inialum-token-generator --service <service_name> --env-file <path_to_env_file>" } }
--service
is required. It is the name of the service that will use the token.--env-file
is optional. If not provided, the tool will look for a.env
file in the root of your project.Run the script in your project:
pnpm run generate-token
License
Licensed under Apache License 2.0.