{"id":18335813,"url":"https://github.com/evervault/template-node-hello-function","last_synced_at":"2025-04-09T19:50:42.138Z","repository":{"id":98938075,"uuid":"554783458","full_name":"evervault/template-node-hello-function","owner":"evervault","description":"Evervault template Hello World Function for NodeJS.","archived":false,"fork":false,"pushed_at":"2023-07-03T13:45:45.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-15T12:16:49.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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":"2022-10-20T11:44:39.000Z","updated_at":"2022-10-25T10:48:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"e35eb97b-3a33-450e-887d-39ad826f3226","html_url":"https://github.com/evervault/template-node-hello-function","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-node-hello-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evervault%2Ftemplate-node-hello-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evervault%2Ftemplate-node-hello-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evervault%2Ftemplate-node-hello-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evervault","download_url":"https://codeload.github.com/evervault/template-node-hello-function/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103934,"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.539Z","updated_at":"2025-04-09T19:50:42.117Z","avatar_url":"https://github.com/evervault.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hello Function\n[Evervault](https://evervault.com) makes it easy to encrypt data at source, process it in a Function — a secure, serverless function — and never store it unencrypted.\n\nThis is a simple Evervault Function example, to help get you up and running on the Evervault platform quickly.\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 Function to be processed securely.\n\nThis Function takes a payload that should contain a `name` key. Running the Function is very simple.\n\n## The steps\n1. Encrypt your data at source, using one of our SDKs.\n2. Process the encrypted data in a Function\n\n### Encrypting at source\n```javascript\n// This example uses the Evervault Node SDK.\nconst Evervault = require('@evervault/sdk');\n\n// Initialize the client with your App's API key\nconst evervault = new Evervault('\u003cYOUR-API-KEY\u003e');\n\n// Encrypt your data\nconst encrypted = await evervault.encrypt({ name: 'Claude Shannon' });\n```\n\n### Process your encrypted data in a Function\nYou should encrypt this payload using either our Node SDK or Browser SDK, then run it in the Hello Function:\n\n```javascript\n// Process the encrypted data in a Function\nconst result = await evervault.run('\u003cYOUR_FUNCTION_NAME\u003e', encrypted);\n```\n\n## Understanding the Function\nThis Function is very simple. Here is the full code:\n\n```javascript\nexports.handler = async (data) =\u003e {\n  if (data.name \u0026\u0026 typeof data.name === \"string\") {\n    console.debug(`A name of length ${data.name.length} has arrived into the Function.`);\n\n    return {\n      message: `Hello from a Function! It seems you have ${data.name.length} letters in your name`,\n      name: await context.encrypt(data.name),\n    };\n  } else {\n    console.debug('An empty name has arrived into the Function.');\n\n    return {\n      message: 'Hello from a Function! Send an encrypted `name` parameter to show Function decryption in action',\n    };\n  }\n};\n```\n\nOr check it out in [index.js](./index.js).\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-node-hello-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevervault%2Ftemplate-node-hello-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevervault%2Ftemplate-node-hello-function/lists"}