How to get extension id?

You need extension id for external auth and supabase auth and you need while you are developing your extension.

Be aware that the extension id of your locally unpacked extension is different from the extension id that is there for your extension in the chrome store. Follow the below steps to get an id which doesn't change.

So let's generate the extension id from chrome developer console first.

To get the extension id from the developer console, create a new item in the developer console and add your extension.zip file. You get extension.zip file by compressing the extension directory. The extension doesn't have to be complete. In this case you can use the extension directory from the templates provided. Save it as draft and you will find the id of your extension. Navigate to the package tab and grab the public key from there.

The public key will look like this.

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzTZZLk+mZHxvzcgleOPr
JeTXtZdoiC8ixmD+eNGyyi1GWyQ5VT5JziX4k3BmdElN6jvAEDF6PJhCDaQim9Cm
yFjI2Mg6cB2H34fqIwkTFC52r8iS4/e5kUKe3NP8jT0QXbVTMGrp59JdLwXrG4+z
HlZs+h4/SRacsc9BgjQI5JyS6tCHczEpTsKH6L5PxQdZeA+j0TbFHs616TmFPnRW
dPnVD5uKTWCWmEScpoT163g39X+zs8l6AYW3t3dSIv0OZXBa6FkiFyCGBlKTi4bj
IWvwBhUggRe3TtVrSkPx/VkSDcmjwA38vjJq1S1M2pX3x7rGTxKOZYYEmQjj3rX9
hQIDAQAB
-----END PUBLIC KEY-----

Copy the content of the public key and add it to manifest.json file. Don't include -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- in the value you add in manifest.json.

You can see in extension/manifest.json there is key and there is the public key added to it. Replace it with your public key.

{
    key: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzTZZLk+mZHxvzcgleOPrJeTXtZdoiC8ixmD+eNGyyi1GWyQ5VT5JziX4k3BmdElN6jvAEDF6PJhCDaQim9CmyFjI2Mg6cB2H34fqIwkTFC52r8iS4/e5kUKe3NP8jT0QXbVTMGrp59JdLwXrG4+zHlZs+h4/SRacsc9BgjQI5JyS6tCHczEpTsKH6L5PxQdZeA+j0TbFHs616TmFPnRWdPnVD5uKTWCWmEScpoT163g39X+zs8l6AYW3t3dSIv0OZXBa6FkiFyCGBlKTi4bjIWvwBhUggRe3TtVrSkPx/VkSDcmjwA38vjJq1S1M2pX3x7rGTxKOZYYEmQjj3rX9hQIDAQAB'
}

This ensures that the id remains the same in the chrome web store and in your local.

Last updated