Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@vgs/netlify-plugin-vgs
Advanced tools
The plugin makes your integration with VGS smoother by helping with: - configuring your vault routes with collect.js confguration - applying all routes from `vgs/routes.yaml` file, so they will be updated with each netlify deployment.
The plugin makes your integration with VGS smoother by helping with:
vgs/routes.yaml
file, so they will be updated with each netlify deployment.In this guide, we cover:
First, get clientId
and clientSecret
credentials by following this guide.
Then, get the ID of your vault vaultId
in the VGS Dashboard
Finally, let's create environment variables on the Netlify side, so they will be available during each build (go to the Platform section and copy it from the top of the page)
netlify env:set VGS_CLIENT_ID <clientId>
netlify env:set VGS_CLIENT_SECRET <clientSecret>
netlify env:set VGS_VAULT_ID <vaultId>
First, create a folder and initialize netlify site by running:
netlify init
Create a simple src/index.html
file with a form:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>VGS <-> Netlify Plugin demo</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<form id="vgs-collect-form">
<label>Email</label>
<div id="email" class="form-field"></div>
<label>Password</label>
<div id="password" class="form-field"></div>
<button type="submit">Log in</button>
</form>
<script src="https://js.verygoodvault.com/vgs-collect/2.14.0/vgs-collect.js"></script>
<script type="module" src="app.js"></script>
</body>
</html>
Add some styles to src/style.css
file
* {
box-sizing: border-box;
}
html {
font-size: 10px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI";
}
iframe {
width: 100%;
height: 100%;
}
form {
width: 400px;
margin: 20px auto;
}
label {
display: inline-block;
font-size: 1.2rem;
margin-bottom: .6rem;
text-transform: uppercase;
}
.form-field {
width: 100%;
height: 4rem;
position: relative;
margin-bottom: 1.6rem;
border-radius: 4px;
box-shadow: 0 0 3px 0px #bcbcbc;
padding: 0 10px;
border: 1px solid transparent;
}
.form-field-group {
display: flex;
flex-flow: wrap;
}
.form-field-group div {
flex: 0 0 50%;
}
.form-field-group div:first-child div {
border-radius: 4px 0 0 4px;
clip-path: inset(-3px 0px -3px -3px);
}
.form-field-group div:last-child div {
border-radius: 0 4px 4px 0;
}
button[type="submit"] {
width: 100%;
color: white;
background-color: #1890FF;
margin-top: 1.6rem;
text-transform: uppercase;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI";
font-size: 1.4rem;
height: 4rem;
font-weight: 400;
text-align: center;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
border-radius: 0.25rem;
}
.form-field.vgs-collect-container__focused {
border-color: #1890FF;
}
.form-field-group .form-field.vgs-collect-container__focused {
clip-path: none;
}
and src/app.js
, which initializes the collect.js library. Take a look at env vars:
process.env.VGS_VAULT_ID
- it contains vaultId we've added to netlify previouslyprocess.env.VGS_ROUTE_ID
- this one will be created automatically by the plugin during deployment.const vgsForm = VGSCollect.create(
process.env.VGS_VAULT_ID,
'sandbox',
(state) => {}).setRouteId(process.env.VGS_ROUTE_ID);
const css = {
boxSizing: 'border-box',
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI"',
color: '#000000',
'&::placeholder': {
color: '#bcbcbc'
}
};
vgsForm.field('#email', {
type: 'text',
name: 'login_email',
placeholder: 'e.g. test@example.com',
validations: ['required'],
css
});
vgsForm.field('#password', {
type: 'password',
name: 'login_password',
validations: ['required'],
placeholder: 'password',
css
});
document.getElementById('vgs-collect-form').addEventListener('submit', (e) => {
e.preventDefault();
vgsForm.tokenize((status, response) => {
if (status === 200) {
/**
* Retrieve tokens from the response and send them to your server.
*/
console.log(response);
}
}, (error) => {
console.log(error);
});
});
Now, create netlify.toml
file with the following contents:
[build]
publish = "dist/"
command = "npm run build"
[dev]
command = "npm start"
[[plugins]]
package = "@vgs/netlify-plugin-vgs"
And the last thing, create a package.json
file, it should contain:
@vgs/netlify-plugin-vgs
parcel
to help with the build process"source": "src/index.html"
:{
"name": "netlify-plugin-example",
"version": "1.0.0",
"source": "src/index.html",
"scripts": {
"start": "parcel",
"build": "parcel build"
},
"devDependencies": {
"@vgs/netlify-plugin-vgs": "0.0.4",
"parcel": "^2.6.2"
}
}
and install dependencies by running
npm install
Now, your directory structure should look like this:
your-app
├─ ...
├─ src
| |─ index.html
| |─ style.css
| └─ app.js
├─ netlify.toml
└─ package.json
Now, you are ready to start the development server, you can do it by running. It will build your app and open the browser with your running app at http://localhost:8888
netlify build && netlify dev
This command will build and deploy your code to production. In the output you will find a public URL with your app.
netlify build && netlify deploy --production
FAQs
The plugin makes your integration with VGS smoother by helping with: - configuring your vault routes with collect.js confguration - applying all routes from `vgs/routes.yaml` file, so they will be updated with each netlify deployment.
We found that @vgs/netlify-plugin-vgs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.