Deploy a pre-registration hook in Strivacity which can retrieve contact information from HubSpot and perform data comparisons before allowing users to register.
In our example integration, we will be doing comparisons based on the email domains which users have registered in HubSpot. Only existing domain values will be allowed to register.
- Basic understanding of HTTP request/response flows
- Web application development experience
- HubSpot custom integration developer tenant
- Familiarize yourself with HubSpot's API-client package
- HubSpot API key. Find more information about the API key in HubSpot’s knowledge base.
If your admin account is unable to retrieve an API key, you may need to first provision a HubSpot "test account", and use the test account's API key.
- Sample contacts in your developer tenant.
At least one sample contact with an email value is required.
Two sample contacts are added automatically for you when registering a HubSpot developer tenant. Please review these contact details or create your own test contacts before proceeding.
- A Strivacity tenant for testing
- Identity Store supporting 'EMAIL' identifiers
- An application in your Strivacity tenant to apply and test the Lifecycle Event Hook
1) Select 'Custom integration' on the HubSpot developers' page.
2) Before you continue, you will be directed to HubSpot’s guide about how to obtain the API key of your tenant.
Capture the API key for future use.
3) Follow HubSpot's onboarding process.
4) Check 'Contacts' for your example customers.
Optional You may add additional contacts to test use cases not covered in this example.
1) In the Admin Console, got to Lifecycle Event Hooks.
2) Click 'Create Lifecycle Event Hook'
3) Fill in the basic information:
- Name your new hook
- Add a description
- Select 'Pre-Registration' for the hook type
4) Save to continue.
5) Click the gears icon on the top left corner of the IDE panel.
6) Select Add Dependency.
7) Search for and add the following packages:
Note: Beta packages may not be stable. For best results use the latest stable package versions.
Your screen should now look like this:
You may collapse the Dependencies menu at this time.
8) Go to our repository to fetch the Pre-Registration hook we provide as a jumping-off point for HubSpot integration.
9) Replace the default Pre-Registration code block with the hook code from the repository.
10) At HUBSPOT_APIKEY, replace '_api__key' with the API key you have obtained from your HubSpot tenant.
11) Save your hook.
Your hook's status will stay Non-Deployed until you add it to an application.
1) Go to Applications and click 'Create Application'.
2) Add a name, description, and define the mandatory properties of the application.
3) Ensure the Identity Store supports the 'EMAIL' identifier.
4) Scroll down to Lifecycle Event Hooks and assign your Pre-Registration hook to your Strivacity test application to integrate with HubSpot.
5) Save your changes.
Copy the test application's self-service URL.
1) Go to an incognito browser.
Make sure only one incognito window is open as multiple windows share session information.
2) Go to the self-service portal of the Strivacity application.
3) Try to sign up as a customer who has the same email address domain as one of your Hubspot contacts.
According to our example hook, this customer will be allowed registration.
4) Try to sign up as a customer whose email address isn't among your Hubspot contacts.
According to our example hook, this customer will be denied registration.
Implement additional logic for customers denied registration.
Updated 4 months ago