Add a client API?
See original GitHub issueFirst off, thanks for this project, I love it!
I don’t like a full refresh on each page change so I added barba.js in order to load the pages over AJAX instead. This obviously broke giscus, I hacked around a solution that involves changing the iframe src
on page change via JS but I was wondering if there’s a better way to solve this.
I don’t know if that’s possible but will you consider adding a JS client API so that we can programmatically load the discussion?
You can see my tiny js code here and you can see it in action at https://games-on-whales.github.io/gow/
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
AddClient - WHMCS Developer Documentation
WHMCS developer documentation - themes, modules, hooks, oauth, api and ... Adds a client. ... firstname, string, First name of the client to...
Read more >How to create a Client for your API — .NET | by Tiago Martins
In my opinion, this is a simple and efficient way to create clients for APIs. The fact of having multiple controllers doesn't create...
Read more >Add an API Client - Salesforce Commerce Cloud Infocenter
Log into Account Manager. · Click API Client. · Click Add API Client. · In the Display Name field, enter the display name...
Read more >Adding a New Client | API | Zoho People
Adding new clients using API in Zoho People. ... This API is used to add client. ... *clientName, <Client name>, <Mandatory>, Specify the...
Read more >Quickstart: Configure a client application to access a web API
Select Azure Active Directory > App registrations, and then select your client application (not your web API). Select API permissions > Add ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you for your patience, it works perfectly! 🎉 I feel dumb to have missed that, I just tried to see thru the Typescript since I’m just on plain JS and I missed those keys!
@ABeltramo Ah, I just realized: you need to wrap the object in this format:
Sorry if it doesn’t seem so intuitive. The reason is:
giscus
key because other apps might also send messages to the window (e.g. browser extensions). The key ensures that the data is specifically intended for giscus.setConfig
key because there may be other types of messages that will be supported by giscus in the future. I could’ve added a property liketype: 'set-config'
and just put the rest of the data without wrapping it insetConfig
, but I chose the current approach because it lets you namespace the data for each type of message and still be able to check the type (usingif ('setConfig' in giscus
)).This is why I added a boilerplate example in the guide:
It seems to work on my website:
(Sorry for the screen glitch, screen recording doesn’t seem to work well on my linux setup.)