Skyflow Elements provides a secure way to collect and reveal sensitive data, such as personally identifiable information (PII) and credit card information (PCI). It offers several benefits, including complete programmatic isolation from your frontend applications, end-to-end encryption, tokenization, and the ability to customize the look and feel of the data collection form.
You can integrate Skyflow Elements into existing applications and workflows by installing server-side and client-side Skyflow SDKs, initializing the SDKs with your Skyflow credentials, and using the client-side SDK to create and customize the data collection form.
When your users interact with Skyflow Elements, various components work together to collect and reveal sensitive data. Here’s how it works:
Sign in to your Skyflow account. If you don’t have an account, sign up for a free trial.
Basic knowledge of JavaScript and Node.js
Basic knowledge of HTML and CSS
A device with the following tools installed:
A vault and its details: 1. In Studio, click the vault menu icon > View vault details. 2. Note your Vault URL, and Vault ID values.
You may want to collect many kinds of sensitive data from your users. Here are some common examples:
Make sure your vault has the appropriate tables and columns to store the data you want to collect.
This tutorial uses the Quickstart vault template and focuses on securely collecting the columns in the persons
table:
name
email_address
ssn
date_of_birth
state
To use Skyflow Elements, you need to define a role to control what the SDKs can access and a service account to let the SDKs authenticate and access Skyflow according to their role.
In Studio, click Settings in the upper navigation.
In the side navigation, click Vault, then choose your vault from the dropdown menu.
Under IAM, click Roles, then Add New Role.
For Name, enter “Collect PII”.
For Description, enter a value. For example, “Restrictive vault access”.
Click Create.
Click Attach Policies, and replace the placeholder content with the following policies:
These policies let you gather data from your client, insert it into your vault, and return tokens to your client.
If you have a requirement to display data, add the following policies:
Caution: Revealing data in your interfaces exposes that data to your users. Only use reveal elements when necessary, and make sure you have adequate access policies in place when you do.
Click Create, enter “Collect PII” for the policy name, then click Save.
Click Enable, then close the dialog.
Your browser downloads a credentials.json
file. Store this file in a secure location. You’ll need it to generate bearer tokens.
Now that you’ve created your vault and defined your role and service account, it’s time to integrate with the server-side SDK.
In a terminal, run the following commands:
Move your credentials.json
file to the root directory of your project.
Create server.js
in the root directory of the project with the following code:
Run the server:
In a new terminal, check to make sure you can fetch a bearer token from your server:
You should see a bearer token in the response. If you don’t, check your first terminal for errors.
Now that you’ve integrated with the server-side SDK, it’s time to integrate with the client-side SDK.
Create elements.html
in the root directory of the project with the following code. Update VAULT_ID
and VAULT_URL
with your vault’s values.
This code does the following:
In a browser, open http://localhost:3000.
You should see a form with input fields. When you enter a value and click Submit, the SDK sends the value to your vault and returns a token for the value. Store tokens in your data store instead of the actual values.
When you click the Reveal button, if you added the DETOKENIZATION
policy, the SDK uses the token to retrieve the value from your vault and display it on the page. If you didn’t add the DETOKENIZATION
policy, the SDK returns an error.
You now have a functional, if minimal, integration with Skyflow Elements. There are a few ways you can improve the current integration:
For information on these topics, see the Skyflow JavaScript SDK.