Build an app on top of the CRM
Last updated 18 November 2026Applies to CRM v6.1
When you finish this tutorial, you have a member area on your site that lists your CRM contacts, adds new ones and edits existing ones. Only people who are signed in can open it. It takes about 45 minutes.
You need a site, a local project that syncs to it, and some Liquid and GraphQL basics. If you have not set these up, work through Set up your environment first. Connect to CRM in the same course explains how contacts, companies and activities fit together.
You create seven files in your project:
| File | What it does |
|---|---|
app/authorization_policies/members_signed_in.liquid | Lets only signed-in people in |
app/graphql/members/contacts.graphql | Reads a page of contacts |
app/views/pages/members/contacts.liquid | Lists the contacts |
app/views/pages/members/contacts/new.liquid | The form to add a contact |
app/views/pages/members/contacts/create.liquid | Saves the new contact |
app/views/pages/members/contacts/edit.liquid | The form to edit a contact |
app/views/pages/members/contacts/update.liquid | Saves the changes |
Step 1 of 8
Protect the member area
Start with access control, before any page shows data. A page with no authorization policy is public. Create a policy that admits only signed-in people:
app/authorization_policies/members_signed_in.liquid
---
name: members_signed_in
redirect_to: /
flash_alert: Please sign in to see the member area.
---
{%- if context.current_user.id != blank -%}
true
{%- else -%}
false
{%- endif -%}The policy runs before the page does. It must print true or false on every path, so the deny path is written out. When it prints false, Insites sends the visitor to redirect_to and shows the flash_alert message.
Note
This policy admits anyone who is signed in to your site. For a real member area, also check something only members have, such as a role. See Permissions.
Check it worked: sync the file. Nothing changes yet, because no page uses the policy.
All 8 steps done
You finished Build an app on top of the CRM. Pick where to go next.