PostHog / squeak

A Q&A widget for your docs
https://squeak.posthog.com/
MIT License
178 stars 15 forks source link

Allow configuration of "Ask a question" and "reply to question" #248

Open pjhul opened 2 years ago

pjhul commented 2 years ago

Original issue: https://github.com/PostHog/squeak-react/issues/55

I wanted to use squeak to add a discussion to a page on my site... But it isn't Q&A

Screenshot 2022-07-17 at 17 50 40

Would be awesome to init squeak.js on the page with what I'd like it to say. In this case, something like "what are you a signpost for?" and "reply to this"

pjhul commented 2 years ago

So you'd have squeak.js in the page with something like

<script>
    (function() {
        window.squeak = {
            supabase: {
                apiKey: "blah"
                url: "https://somewhere.supabase.co",
            },
            apiHost: "https://squeak.cloud",
            organizationId: "a-uuid",
                         // new config here
            askLabel: "I'm a signpost for...",
            replyLabel: "comment on this"
        };
        var d = document,
            s = d.createElement("script");
        s.src = "//somewhere.cloudfront.net/squeak.js";
        (d.head || d.body).appendChild(s);
    })();