Overview
Relay is a hosted JavaScript widget that lets you embed Fruga's cashback rewards experience directly inside your platform - with minimal integration effort.
Relay is designed to be embedded in your web application as an iframe. Your users interact with it without ever leaving your platform, and you stay in full control of where and how it appears.
How it works
Your backend authenticates the user and generates a short-lived signed token. The Relay widget uses that token to securely identify the user on Fruga’s side - no separate login required. Once authenticated, users can view their cashback balance, browse offers, and receive payouts.
Relay Integration Flow
Fruga provides you with a Partner Key and a Signing Secret for your environment. These are used to authentica API requests your environment and sign user assertions.
Add the Relay script to your page. The SDK handles widget mounting, session establishment, versioning, and iframe lifecycle automatically.
When a user loads the widget, your backend generates a short-lived JWT assertion using your Signing Secret. This enables Relay to establish a verified session without requiring a separate login.
When a qualifying event occurs (e.g., policy purchase, claim excess reimbursement), your backend submits a cashback claim request to the Relay Partner API. We handle the rest - balance update, payout prompt, and user notification.