InboxSDK and Create React App

556 views
Skip to first unread message

Kwasi Oppong-Badu

unread,
Jul 27, 2021, 3:01:50 PM7/27/21
to InboxSDK
Does anyone have any tips for setting up InboxSDK in a React project generated by Create React App?  It seems like the lack of clarity about how to proceed is a perennial issue:

Here is a question about how to structure the project to make InboxSDK available to the content script:

This one offers some guidance on initializing a React project (without CRA) but is out of date by almost 4 years:

I've been able to create an extension with CRA + Typescript + Tailwind that can be compiled by Webpack, and render React inside of the extension popup, but I continue to struggle to get InboxSDK to be recognized inside content.js. In the browser I consistently get an error thrown from content.js:

Uncaught ReferenceError: InboxSDK is not defined

I've attached a minimal example to demonstrate my current setup in the hopes that someone might be able to help me see something that I've been missing. Thanks!


PS: I haven't ejected the app, so I'm using CRACO to handle the webpack configuration.

Amiram Korach

unread,
Jul 27, 2021, 3:34:04 PM7/27/21
to Kwasi Oppong-Badu, InboxSDK
Try to put inboxsdk.js before the content script in the manifest.

--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/db88b73b-e9c5-4c49-b0b5-72c59b8cf768n%40googlegroups.com.

Kwasi Oppong-Badu

unread,
Jul 27, 2021, 4:19:27 PM7/27/21
to InboxSDK
I had the feeling it was something small but obvious... thanks so much!
Reply all
Reply to author
Forward
0 new messages