{"id":22370287,"url":"https://github.com/push-protocol/embed-demo-app","last_synced_at":"2025-03-26T16:25:12.812Z","repository":{"id":103176184,"uuid":"483527281","full_name":"push-protocol/embed-demo-app","owner":"push-protocol","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-26T13:10:20.000Z","size":579,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-31T19:48:17.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/push-protocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-04-20T06:03:28.000Z","updated_at":"2022-12-30T19:48:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"e648ec44-7467-4e28-b75e-b3244058ef9a","html_url":"https://github.com/push-protocol/embed-demo-app","commit_stats":null,"previous_names":["push-protocol/embed-demo-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/push-protocol%2Fembed-demo-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/push-protocol%2Fembed-demo-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/push-protocol%2Fembed-demo-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/push-protocol%2Fembed-demo-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/push-protocol","download_url":"https://codeload.github.com/push-protocol/embed-demo-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245690662,"owners_count":20656628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T19:38:50.005Z","updated_at":"2025-03-26T16:25:12.791Z","avatar_url":"https://github.com/push-protocol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## DEMO\n\n```\nyarn install\nyarn start\n```\n1. click on the Button/icon on the page on top right - you will see a sidebar/modal with a close button\n2. click on the close button or the black overlay to close the sidebar/modal.\n\n## NOTE: \nThere is no polling mechanism as of now, the Client APP has to re-load to get new notifications. [WIP]\n\n\n## Usage Guide when integrating `EmbedSDK` from scratch in a client dApp\nFor using the `EmbedSDK` in your app, you can \n\nUSING AS AN NPM PACKAGE\n------------------------\nFirst\n\n    yarn add @epnsproject/frontend-sdk-staging\n\nthen, In `App.js` of your App entry point\n\n\n    import { EmbedSDK } from \"@epnsproject/frontend-sdk-staging\";\n\n\nadd in HTML/JSX the below HTML tag -\n\n\n    \u003cbutton id=\"sdk-trigger-id\"\u003etrigger button\u003c/button\u003e\n\nor any component with the ID ***sdk-trigger-id*** \n\n***Make sure the ID you give to the \"button\" is same as that of the targetID you pass to the init() below*** \n\nAfter the wallet connect happens in your app flow trigger the below code snippet.\n\n**Note:** You have to have the wallet connected with an account to execute the below code because internally the SDK calls the EPNS `get_feeds()` API which needs the account address. You will see notifications if you have opted-in to a channel using [EPNS](https://staging-app.epns.io/)\n\n```\n  useEffect(() =\u003e {\n    if (account) { // 'your connected wallet address'\n      EmbedSDK.init({\n        headerText: 'Hello DeFi', // optional\n        targetID: 'sdk-trigger-id', // mandatory\n        appName: 'consumerApp', // mandatory\n        user: account, // mandatory\n        viewOptions: {\n            type: 'sidebar', // optional [default: 'sidebar', 'modal']\n            showUnreadIndicator: true, // optional\n            unreadIndicatorColor: '#cc1919',\n            unreadIndicatorPosition: 'bottom-right',\n        },\n        theme: 'light',\n        onOpen: () =\u003e {\n          console.log('-\u003e client dApp onOpen callback');\n        },\n        onClose: () =\u003e {\n          console.log('-\u003e client dApp onClose callback');\n        }\n      });\n    }\n\n    return () =\u003e {\n      EmbedSDK.cleanup();\n    };\n  }, []);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpush-protocol%2Fembed-demo-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpush-protocol%2Fembed-demo-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpush-protocol%2Fembed-demo-app/lists"}