SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

How do I make my Twilio credentials available to my functions?

Objective

This article shows you how to have Twilio add your account credentials to a Functions service as environment variables, so your function code can call the Twilio API without you storing the credentials yourself.

 

Product

Twilio Functions and Assets

 

Environment

Twilio Console

 

Procedure

  1. In the Twilio Console, select Builder tools in the left sidebar.
  2. Select Functions & Assets, then Services.
  3. Select the name of the service you want to configure.
  4. Select the Environment variables tab.
  5. Select the checkbox labelled Add my Twilio credentials (ACCOUNT_SID and AUTH_TOKEN) as environment variables.
  6. The setting is saved for the service as soon as you change it.

 

Additional Information

  • With the setting on, your function code reads the credentials from the context object as context.ACCOUNT_SID and context.AUTH_TOKEN.
  • Clear the checkbox to stop supplying the credentials to the service. Any function that relies on them will no longer be able to read them.
  • For any other secret your functions need, add it yourself as an environment variable. 

 

This content was generated by AI and reviewed, edited, and verified by a human.

Have more questions? Submit a request
Powered by Zendesk