{"id":18335814,"url":"https://github.com/evervault/template-twilio-cage","last_synced_at":"2025-04-09T19:50:46.238Z","repository":{"id":43339673,"uuid":"292540533","full_name":"evervault/template-twilio-cage","owner":"evervault","description":"Evervault template Twilio Cage.","archived":false,"fork":false,"pushed_at":"2024-08-30T14:57:47.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T12:16:57.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evervault.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-03T10:41:25.000Z","updated_at":"2024-08-30T14:57:51.000Z","dependencies_parsed_at":"2024-11-05T20:10:38.250Z","dependency_job_id":null,"html_url":"https://github.com/evervault/template-twilio-cage","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evervault%2Ftemplate-twilio-cage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evervault%2Ftemplate-twilio-cage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evervault%2Ftemplate-twilio-cage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evervault%2Ftemplate-twilio-cage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evervault","download_url":"https://codeload.github.com/evervault/template-twilio-cage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103930,"owners_count":21048244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T20:04:57.555Z","updated_at":"2025-04-09T19:50:46.208Z","avatar_url":"https://github.com/evervault.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twilio Cage\n[Evervault](https://evervault.com) makes it easy to encrypt data at source, process it in a Cage — a secure, serverless function — and never store it unencrypted.\n\nThis is a simple Evervault Cage example, to help get you up and running on the Evervault platform quickly, using an external API (Twilio).\n\n## Getting started with Evervault\n\nEvervault consists of two parts, encrypting your data at source, using either our Node SDK, or Browser and React SDKs and then sending that encrypted data to a cage to be processed securely.\n\nThis Cage takes a payload that should contain two keys, `body` and `to`, representing the message and the number this message will be sent to.\n\n## The steps\n1. Encrypt your data at source, using either the Node SDK or Browser and React SDKs.\n2. Process the encrypted data in a cage\n\n### Encrypting at source\n```javascript\n// This example uses the Evervault Node SDK.\nconst Evervault = require('@evervault/sdk');\n// Initialize the client with your team’s API key\nconst evervault = new Evervault('\u003cYOUR-API-KEY\u003e');\n\n// Encrypt your data\nconst encrypted = await evervault.encrypt({ body: 'Hey there from Evervault!', to: '+3538972215123' });\n```\n\n### Process your encrypted data in a cage\nYou should encrypt this payload using either our Node SDK or Browser SDK, then run it in the Hello Cage:\n\n```javascript\n// Process the encrypted data in a Cage\nconst result = await evervault.run('twilio-cage', encrypted);\n```\n\n## Understanding the Cage\nThis cage is very simple, here is the full code:\n```javascript\nconst accountSid = process.env.TWILIO_SID;\nconst authToken = process.env.TWILIO_AUTH_TOKEN;\nconst client = require('twilio')(accountSid, authToken);\n\nexports.handler = async (data) =\u003e {\n  const msg = await client.messages\n  .create({\n     body: data.body,\n     from: process.env.TWILIO_NUMBER,\n     to: data.to\n   });\n   \n   return msg;\n};\n```\n\nOr check it out in [index.js](./index.js).\n\nIn this cage we are using some environment variables. `TWILIO_SID`, `TWILIO_AUTH_TOKEN` and `TWILIO_NUMBER`. You can get your own values for these by [signing up for Twilio](https://www.twilio.com/).\n\nWhen you have them, you can populate them in the Cage view in the [Evervault dashboard](https://app.evervault.com).\n\n--- \nIf you want to know more about Evervault, check out our [documentation](https://docs.evervault.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevervault%2Ftemplate-twilio-cage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevervault%2Ftemplate-twilio-cage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevervault%2Ftemplate-twilio-cage/lists"}