Search code examples
twiliotwilio-functions

What is the purpose of the .twilio-functions file in the Twilio Functions?


I used twilio serverless:init to generate a Twilio service locally and then later deployed it to Twilio. At some point I noticed a file named .twilio-functions present in the root of the project. It's contents looked like this:

{
        "projects": {
                "<redacted>": {
                        "serviceSid": "<redacted>",
                        "latestBuild": "<redacted>"
                }
        },
        "serviceSid": "<redacted>",
        "latestBuild": "<redacted>"
}

What is the purpose of this file? Do I need to keep it? If so, should it be versioned?


Solution

  • .twilio-functions is created when you call twilio serverless:deploy . It basically just keeps a log of the latest build and service SIDs.

    You can delete it if you want, since I don't think it's used anywhere. But I would just leave it, since it doesn't hurt and it will keep reappearing every time you deploy.

    You don't need to store it in version control, since it's an output of the deploy process, like a log. It might already be ignored in the auto-generated .gitignore file. If it's not there, you can add it as was done in these GitHub repos.

    References

    If you want to know where this config file is created: