Inter 🌐 Media

  • Home
  • Blog
  • Portfolio
  • Services
  • Contact

Inter 🌐 Media

  • Home
  • Blog
  • Portfolio
  • Services
  • Contact

Crisp chat, GatsbyJS and dotenv (update)

December 31st, 2019

2 minute read 📗
  • Link to the Crisp chat, GatsbyJS and dotenv (update) podcast on anchorfm

Yesterday, I updated my post GatsbyJS and dotenv to include ryanditjia’s response to my issue on the gatsby-plugin-crisp-chat Github repository.

In order that it is not overlooked or missed by those that listened to the podcast and/or read the post before I added the update, I thought I would create an update podcast to this Crisp chat, GatsbyJS, and dotenv issue.

According to ryanditjia in response to my issue on the gatsby-plugin-crisp-chat Github repository,

Last note: what Crisp says is true, your Crisp website ID is always there on the
final rendered HTML, so it likely won’t matter much to hide it behind (a) .env
file.

This means in Gatsby speak that trying to use environment variables with Crisp, whose real values would render client-side anyway, in the final analysis, would not work! Why?

Because, as ryanditjia states,

... your Crisp website ID is always there on the final rendered HTML, so it
likely won’t matter much to hide it behind (a) .env file.

That means all the solutions I came across would not have worked anyway, even if the websiteId environment variable did not return undefined, because the websiteId, or some relation to it (as I later discovered), renders in the html client side anyway.

In addition, in the end, we can’t add the environment variable to client side code, aka Gatsby React, because there is no Crisp React component element one can add to the JSX, as an example shown in the GatsbyJS docs:

// In any frontend code
render() {
    return (
        <div>
            <img src={`${process.env.GATSBY_API_URL}/logo.png`} alt="Logo" />
        </div>
    )
}

I will be embedding this episode of Plugging in The Holes along with a transcript in the form of a post on interglobalmedianetwork.com for your hearing and reading pleasure. I will be including the related resource links mentioned in the podcast of course. Always do. Bye for now!

Related Resources

  • Environment Variables
  • GatsbyJS and dotenv
Tagged in: gatsbyjs dotenv crisp client-side-javascript
Categorized under: gatsbyjs crisp client-side-javascript
Discuss On Twitter
  • Twitter
  • Linkedin
Maria D. Campbell

Created by Maria D. Campbell who lives and works in New York City building useful things. You should follow her on Twitter. She also has a developer blog mariadcampbell.com you may want to check out!

  • ← Newer
  • Older →
  • Business Hours
  • Monday: 9:00am - 5:00pm
  • Tuesday: 9:00am - 5:00pm
  • Wednesday: 9:00am - 5:00pm
  • Thursday: 9:00am - 5:00pm
  • Friday: 9:00am - 5:00pm
  • Saturday: Closed
  • Sunday: Closed
  • And By Appointment
  • Podast
  • Plugging In The Holes
  • Login
  • Admin Login
  • follow us on Github
  • follow us on Twitter
  • connect with us on Instagram
  • connect with us on Linkedin
ContactSitemapRSS
© 2021 Inter-Global Media Network, Inc.