Prerequisites
Genuin will provide you with the established community under the subdomain URL - website.begenuin.com which you can manage under your brand control center login.Steps to embed Brand Community:
To embed your Brand community into your website, follow the steps below:- Identify the location on your website where you want to embed the community widget.
- Paste the provided code block into the desired location in your website’s HTML markup.
- Adjust the height and width of the embed container as per your design requirements. You can specify these dimensions within the code block itself.
Implementation
HTML Structure
Single Embeds (html)
Embed With Multi Embeds (html)
Prerequisites
Before implementing the multi-embed setup, ensure you have:- Valid Genuin API credentials
- Unique embed IDs for each widget instance
- Access to the Genuin SDK
- Ensure each container has a unique
id
attribute - The multi-embed approach also works for single embeds, so you can use it for both cases if you prefer a unified setup.
Embed With Contextual Feed (html)
Only include the parameters necessary to retrieve a contextual feed.Angular Structure
Note : If you prefer not to inject the script dynamically using JavaScript, you can also include it directly in your HTML using a script tag. However, before initializing or interacting with the embedded element, ensure the following:- The script has finished loading successfully.
- The target DOM element is present on the page.
Single Embeds (Angular)
The following code snippet has been developed using Angular version 16.Embed With Multi Embeds (Angular)
Prerequisites
Before implementing the multi-embed setup, ensure you have:- Valid Genuin API credentials
- Unique embed IDs for each widget instance
- Access to the Genuin SDK
- Ensure each container has a unique
id
attribute - The multi-embed approach also works for single embeds, so you can use it for both cases if you prefer a unified setup.
Embed With Contextual Feed (Angular)
Only include the parameters necessary to retrieve a contextual feed.React Structure
Note : If you prefer not to inject the script dynamically using JavaScript, you can also include it directly in your HTML using a script tag. However, before initializing or interacting with the embedded element, ensure the following:- The script has finished loading successfully.
- The target DOM element is present on the page.
Single embeds (React)
Embed With Multi Embeds (React)
Prerequisites
Before implementing the multi-embed setup, ensure you have:- Valid Genuin API credentials
- Unique embed IDs for each widget instance
- Access to the Genuin SDK
Note:
- Ensure each container has a unique
id
attribute - The multi-embed approach also works for single embeds, so you can use it for both cases if you prefer a unified setup.
Embed With Contextual Feed (React)
Only include the parameters necessary to retrieve a contextual feed.NextJs Structure
Single Embeds (NextJs)
Embed With Multi Embeds (NextJs)
Prerequisites
Before implementing the multi-embed setup, ensure you have:- Valid Genuin API credentials
- Unique embed IDs for each widget instance
- Access to the Genuin SDK
Note:
- Ensure each container has a unique
id
attribute - The multi-embed approach also works for single embeds, so you can use it for both cases if you prefer a unified setup.
Embed With Contextual Feed (NextJs)
Only include the parameters necessary to retrieve a contextual feed.Customisation
Font Family
To apply your application’s custom font styles to the Genuin Web SDK, add the following style block inside the head tag: Note: Please ensure that your custom font is correctly loaded on the page. If the specified font is not available, the SDK will automatically fall back to the default system font.Direct Video Page Redirection
You can use the video parameter during SDK initialization—alongside other parameters—to directly open a specific video page instead of loading the default feed.SDK API’s
Auth Callback
The SDK provides a mechanism to optionally override the default authentication behavior by exposing agenuinAuth
callback on the global window
object.
This is particularly useful when you want full control over how your application handles login or other auth-related actions — such as redirecting to a custom login page or integrating with an existing auth provider.
Auth Callback Parameters
The auth callback passes certain parameters that allow you to perform necessary actions after a user is successfully logged in or redirected — depending on the flow you’ve implemented. For example, it includes returnQueryParams, which is a string containing query parameters that indicate the context in which the auth callback was triggered. This helps determine what action should be taken. Example: If a user is trying to comment on a post and the auth callback is triggered, returnQueryParams might include action=comment. You can extract this action parameter and pass it to the embed to perform the corresponding operation. Note : To use this, you must have the genuin auth callback implemented, the user must be logged in, and you must pass the video slug as well.Dynamically Update SDK Context
You can use the update() method to dynamically change the SDK’s contextual parameters at any point after initialization. This is especially useful when the page content changes based on user interaction (e.g., clicking a new topic, navigating to a different section) and you want the feed to reflect the new context without reinitializing the SDK.Configuration Parameters
Setting | Description |
---|---|
embed_id | The id which you want to embed in your web SDK |
api_key | Unique API key which will be used to authenticate the embed |
token | Your autologin Token which will be used for authenticate |
page_context | The content or context of your webpage, used to render relevant embed feeds. This can include comma-separated keywords or search parameters (e.g., “AI”, “tech news”, etc.). |
lat | Latitude of Location which will be used to retrieve the feed based on Location |
long | Longitude of location which will be used to retrieve the feed based on Location |
name | Full name of the user for automatic login (Autologin) |
mobile | Mobile number or contact information of the user for authentication |
Email address of the user for authentication and communication | |
nickname | Display nickname or username for the autologged user |
profileImage | URL of the user’s profile image to personalize the embedded experience |