Note: This article refers to the Framer desktop app. Learn more about the differences between the Framer web and desktop app here.
To avoid mistakenly committing npm authentication tokens to version control, we recently implemented a change which requires a Framer Token to be part of the environment instead of written to disk.
What is a Framer Token?
The Framer Token is used to identify you with Framer’s npm registry. If you try to publish a package, the Framer Token ensures that your package gets published under the right Framer account.
Installing npm packages
Whenever you try to install an npm package, for instance with yarn, we now ask you to authenticate first. You only need to truly authenticate when you want to publish, so if you are just looking to install an npm package you can run the following exact command:
If you now try to add a new dependency, it should install as expected.
yarn add lodash
Authenticating with a Framer Token
If you’re looking to instead authenticate with your own Framer Token, for instance to publish a package, you need to login with the Framer CLI using the command below.
Note: make sure to replace the placeholder email with the one you use for your Framer account.
npx framer-cli authenticate firstname.lastname@example.org
After running this command, we will automatically send you an email to confirm the request. After you’ve confirmed, the Framer token will automatically be provided on the terminal.
Using this token, you can now perform the command you were originally trying to execute in a single line like so:
FRAMER_TOKEN=<token> npx framer-cli publish
Authenticating by default
If you’d like to authenticate yourself with each terminal session you start, we recommend adding
export FRAMER_TOKEN=<token> to your
.bashrc file. This effectively prepares each new bash environment by automatically authenticating you, reducing the need to do this manually each time.
Using the Framer CLI
Want to learn more about Framer’s Command Line Interface? Make sure to follow the Framer Learn tutorial by Product Specialist Addison Schultz: