Keep secrets
Encrypted credentials, shared across your store’s works.
Add a secret in Shopify
Open Littleworks → Works → Secrets (also linked from Agent access), then choose Add secret. Enter the name your agent expects and save the value. Names are case-sensitive, start with a letter or underscore, and contain letters, numbers, or underscores, up to 64 characters. A store supports 50 secrets; a value is a non-empty string of up to 8 KiB.
Values are encrypted and never shown again in settings. Replace a value to rotate it without redeploying works. Deleting a secret can break works that need it. Refresh if another person changed the secret while you were editing it.
Read a value inside a work
const apiKey = await secrets.get("EMAIL_API_KEY");Secrets belong to the store: one value per name, available to every work and group, in test runs and real runs alike. No manifest declaration is required. get returns the string or throws SECRET_NOT_FOUND. A run keeps the first value it reads for a given name. Replacement and deletion apply to new reads in later runs; an in-progress run may still hold the previous value.
Guide the merchant without handling the value
get_context.secrets lists names and timestamps, plus a manageUrl for this store. Explain which key is needed, where to obtain it, and its minimum required provider permissions. Send the merchant to that URL to enter it. Call get_context again to check availability. Never ask them to paste the value into chat, source, a manifest, or a document. There is no management tool that reveals secret values; an agent with code-deployment access can nevertheless write code that reads them.
Avoid exposing credentials
A value read through secrets.get is registered with the SDK and trusted backend redaction filters before it is returned to the work. Exact occurrences are replaced in captured logs and errors, including nested values and free text. This helps prevent accidental leaks; encoding, splitting, or transforming a value can evade matching. Never log a secret, put it in an error, return it to a caller, or save it in a collection. Outputs and stored documents are not automatically redacted.
Use the value with External requests. Shopify credentials remain managed by Littleworks; use shopify.admin.graphql or shopify.storefront.graphql with the corresponding granted scopes.