The Official Groundwork.JS
You’re using the most ubiquitous programming language. We’ll provide the best library to get up and running on The Groundwork Platform.
Read the docs
Current version: 1.5.4
Installation
There are multiple ways to include Groundwork.JS in your projects. Link directly to it from our secure CDN, install it via npm, or download a copy.
Include Groundwork.JS in any HTML page.
<script src="https://cdn.thegroundwork.com/groundworkjs/1.5.4/groundwork.min.js"></script>
Include Groundwork.JS in your project as a dependency.
npm install groundwork.js --save
Try it out
Groundwork.JS can be used to sign up supporters, submit payments, create events, create user accounts, and more.
This is the code needed to power the Create Profile form
const gw = new Groundwork({
apiKey: 'pub-groundwork.gwjs-dev-center--NlDh0lDuBuBErYSf1V42VvvgiVV8159OZvH6oCEcJ6o3ersG0NqcdeHfQ2o8.J4FQzQz58493HtBu2U58pEoGA'
});
const form = $('#profile-form');
function handleSuccess(res) { /* ... */ };
function handleErrors(err) { /* ... */ };
function handleSubmit(e) {
e.preventDefault();
const profileData = {
givenName: $('#givenName').val(),
familyName: $('#familyName').val(),
email: $('#email').val(),
password: $('#password').val()
};
gw.profiles.create(profileData)
.then(handleSuccess)
.catch(handleErrors);
};
form.on('submit', handleSubmit);