# Knowledge Hub Setup > **Source**: [Wiki](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup) > >

Learn how to set up your knowledge base with Trainn. This collection features all the videos, guides and documentation to get started with building your knowledge base.

## Browse Collection 1. [🚀 Trainn In-App Widget Setup Guide](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/Zw02BK6c39c-trainn-in-app-widget-setup-guide.md) (Article) 2. [In-app Widget Overview](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/e9x9MMBGynk-in-app-widget-overview.md) (Video) 3. [How to create help videos?](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/YUBOStxF49c-how-to-create-help-videos.md) (Video) 4. [Customize Branding](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/JlGtRLogo8Q-customize-branding.md) (Article) 5. [Public & private hub](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/2a6Nm6208AM-public-private-hub.md) (Article) 6. [How to set up a private knowledge hub? ](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/ujm1UCmt664-how-to-set-up-a-private-knowledge-hub.md) (Video) 7. [Single Sign-On SAML (Knowledge Hub)](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/9j1CKkpNV6w-single-sign-on-saml-knowledge-hub.md) (Article) 8. [How to create help guides? ](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/EQo0mXTKbu0-how-to-create-help-guides.md) (Video) 9. [How to create a help article? ](https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/hTLfUZNljdo-how-to-create-a-help-article.md) (Guide) --- # ARTICLE: 🚀 Trainn In-App Widget Setup Guide ## METADATA - id: ppjVRkzE4NrUnSTsx1EnhQ - type: article - source: Wiki - content_url: https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup/Zw02BK6c39c-trainn-in-app-widget-setup-guide - collection_url: https://help.trainn.co/ro3xVitpegw-knowledge-hub-setup ## CONTENT ## **1. Basic JavaScript Snippet Setup** Add this snippet to your application's `` or before closing `` tag: ``` ``` ## **2. Configure Method (Widget Configuration)** Use this to open the widget on button click with learner information: ``` ``` > ### **Note:** Replace the following before going live: > > - `'wiki'` → your actual widget domain/identifier > - `'user@example.com'` → the logged-in learner's email address ### **Example with Dynamic Values (Vue):** ``` window.Trainn('configure', { domainName: 'wiki', learner: { email: this.$user.state.profile.email, }, learnerHash: this.$user.state.learnerHash, }); ``` ### **Example with Dynamic Values (React):** ``` useEffect(() => { if (window.Trainn && user?.email && user?.learnerHash) { window.Trainn('configure', { domainName: 'wiki', learner: { email: user.email, }, learnerHash: user.learnerHash, }); } }, [user]); ``` --- ## **3. User Identity Setup (Optional but Recommended)** For advanced analytics and user tracking: ``` window.Trainn('identity', { email: 'user@example.com', // required }); ``` --- ## **4. Complete Implementation Example** ### **HTML Setup:** ``` ``` --- ## **5. Configuration Parameters** **Parameter** **Type** **Description** `domainName` String Your widget domain/identifier (e.g., 'wiki', 'help') `learner.email` String User's email address `learnerHash` String Secure hash for learner identification --- ## **6. Notes** - **workspace**: Replace `your-workspace-name` with your actual Trainn workspace name - **domainName**: This should match your widget configuration in Trainn dashboard - **learnerHash**: This is a secure identifier - consult with Trainn support on how to generate this - **ee** & **et**: These parameters are not yet documented in official docs - contact Trainn support at `support@trainn.co` for clarification --- ## **7. Next Steps** 1. Go to your Trainn workspace dashboard 2. Navigate to **Configurations** page for In-App Tutorials/Widget 3. Get your **domainName** from widget configuration 4. Generate or get your **learnerHash** (contact support if needed) 5. Copy the setup snippet into your application head/body 6. Add the `configure` method with your learner data 7. Test with a real user and verify widget loads and data is tracked --- ## **Support** For questions or issues: - Email: `support@trainn.co` - Documentation: `https://help.trainn.co/yDNi2PB4MIQ-in-app-tutorials`