Akeem P • over 1 year ago
Accessing the api in a chrome extension
I am trying to access the api in an extension but it's coming back undefined (i can confirm I have it enabled in chrome dev correctly). I notice that there are new instructions for using in chrome extensions (https://developer.chrome.com/docs/extensions/ai/prompt-api) should I be following this instead?
Comments are closed.

4 comments
Dani Ratner Manager • over 1 year ago
Yes, please follow that link!
ak55m Mohammed • over 1 year ago
Hi I followed the link but when I try to register for the code I get an error saying "Error: Enter an origin without a path." I am using the ID of my extension but it isn't creating a token. Does the error mean don't use my extension ID? Look forward to your reply. Thanks!
ak55m Mohammed • over 1 year ago
Akeem P, do you mind telling me how did you get your token for the Prompt API.
Akeem P • over 1 year ago
I used the id from the extension but it was prefixed with "chrome-extension://" when set as the "Web Origin". Also your id changes unless you specify the id as the key in the manifest