Integrate in 10 Minutes
Don't have the time for API-based integration? Nexus has you covered.
If you're looking to add some quick coverage of student loan functionality to your product or platform, but aren't ready to spend the time designing, architecting, and building your own customized Consumer
experience, Nexus has you covered.
What you'll need
- A Nexus Key
- A few lines of JavaScript
Don't have your Nexus Key?
Please contact [email protected] and we'll get that sorted.
Warning: Don't share your keys!
Your API keys are extremely sensitive. Anyone who gains access to your keys will be able to impersonate you. Never expose your API keys in any publicly accessible areas, including GitHub, client-side code, or even a plain HTTP request. If you are ever in doubt that your API keys may have been exposed, contact us immediately!
What we'll do
- Add the Nexus script tag to a page in your site
- Initialize Nexus to create a
Consumer
record for you without our API - Add a click event listener to trigger the Nexus widget
- Rely on Nexus to link, provide an assessment, and enroll your borrower in an Income-Driven Repayment Plan
- Do something meaningful with the results
Let's get started
Add the Nexus script
tag
script
tagYou must include the Nexus script
tag in your app's markup. Where you place it in your markup is up to you, of course, but you must ensure it is included and loaded before any event handlers are triggered.
<script src="https://payitoff-cdn.io/sandbox/nexus/js/v1"></script>
Integration begins in the Payitoff Sandbox
For local development, staging, and testing environments, you'll want to include the sandbox version of Nexus.
Payitoff's Sandbox is your development playground—it will never connect to live data, it won't submit real Enrollment Requests, and you'll use a Sandbox Nexus Key that only works in our Sandbox environment. To use curated dummy data, check out our guide to using data snapshots.
Initialize Nexus with your own Consumer IDs
The Nexus experience is unique to each of your Consumers
based on their Debt
portfolios, so it accepts a Consumer
identifier on init. To ease API-free integration, you can provide your own unique Consumer
identifier when initializing Nexus. If we've never seen that Consumer
before, Nexus will create a new Consumer
record for you. If we have seen the Consumer
with your unique external ID before, Nexus will recognize that, find the Consumer
, and load workflows for their situation.
Nexus({
nexus_key: 'GIVINGHERALLSHESGOT',
consumer: 'jamestkirk1966'
})
Triggering Nexus on a click event
Let's assume we have a button in the page that is meant to trigger opening the Nexus widget:
<a id="nexus" class="button">Enroll via Nexus</a>
Given this button-styled a
tag in your page, let's write a simple click
handler that can open Nexus, telling Nexus we want our Consumer
to be enrolled in an Income-Driven Repayment Plan of their choosing. To do this, we'll also want to provide an onEvent
callback function so we can inspect the response from Nexus when important events happen such as the Consumer
completing enrollment or exiting the widget.
let nexusButton = document.querySelector('#nexus')
// Attach click handler to invoke Nexus.enroll with callback functions
nexusButton.addEventListener('click', e => {
Nexus.enroll({
// the function to call when something important happens
onEvent: function(response) {
// we'll just console.log our response so we can inspect it
console.log(response)
},
})
})
That's it!
When the Nexus widget is closed, it will call the onEvent
callback function you provided with the results. See the docs on individual workflows like LinkToEnroll and Guidance for the workflow-specific events you can expect.
Ready to learn more about Nexus workflows, callbacks, and results? Head over to our Nexus pages for all you need to know to better understand how Nexus works, and how you can put it to work in your products and platforms.
Updated 6 months ago