Script Credentials & Allowed Domains

Updated Jul 21, 2026
DataMagik Automate

Script Credentials & Allowed Domains

Scripts often need a secret (an API key, a token, a username/password) and permission to call an outside service. DataMagik keeps those two concerns separate and safe: Credentials store secrets your scripts reference by name, and Allowed Domains is the allowlist of hosts a script's fetch() is permitted to reach.

Credentials

Company-wide credentials are shared across all scripts in your company. Manage them under Script Engine > Credentials.

Credentials page listing named credentials with type, status, and last-updated
Each credential has a name and a type — Basic Auth, Secret, or API Key.
  1. Click Add Credential, give it a name, choose a type (Basic Auth, Secret, or API Key), and enter the value(s).
  2. Reference it in a script by name — the secret value is injected at run time and never exposed:
const key = credentials.get("SHIPENGINE");   // returns the stored secret at run time
Secret values are write-only. The list shows a credential's name, type, and status — never the secret itself. Update a value by editing the credential; you can't read it back out.

Allowed Domains

For security, a script's fetch() can only reach hosts you've explicitly allowed. Manage a script's allowlist from its Script Settings panel (the gear icon in the editor), alongside the credentials that script uses.

Script Settings panel showing Credentials and Allowed Domains add buttons
Attach credentials and add allowed domains from a script's settings.

Open Script Settings, then use + Add under Allowed Domains to whitelist each host the script calls (for example api.shipengine.com). A fetch() to a host that isn't on the list is blocked.

The usual pattern: add a Credential for the service's secret, add the service's host under Allowed Domains, then in the script inject the secret with credentials.get() and call the host with fetch(). Never hard-code a secret in script source.
Related: Write scripts in the Script Engine; for Plex data sources use plex.execute() (governed by Plex API Access) rather than fetch().
Was this page helpful?