Setting Neptune credentials#
Neptune generally needs two things in order to send the metadata to the correct place:
- An API token. This is a long, unique string that works as authentication to the application. It can be the token of a user account or a service account.
- A project name. The account associated with the API token must have access to the workspace and project in question.
Saving your credentials as environment variables#
As a best practice in your workflow, set your Neptune API token and full project name to the
NEPTUNE_PROJECT environment variables, respectively.
Finding your credentials#
In the top-right corner of the Neptune app, click your avatar and select Get your API token.
Your full project name has the form
workspace-name/project-name. To copy the name, navigate to your project → Settings → Properties.
Setting credentials in Colab#
If you're working in Google Colaboratory, you can set your credentials with the os and getpass libraries:
Note that these won't persist when the notebook kernel is terminated. You'll need to declare the variables again if you restart the notebook.
Passing credentials without environment variables#
While it's not a recommended practice especially for the API token, you can also pass your Neptune credentials in the code when initializing Neptune.
If you haven't registered, you can also log anonymously to a public project (make sure not to publish sensitive data through your source code!):