google-gemini / generative-ai-js

The official Node.js / Typescript library for the Google Gemini API
https://ai.google.dev/
Apache License 2.0
502 stars 96 forks source link

support specifying the application and signature. #164

Open 0wwafa opened 3 weeks ago

0wwafa commented 3 weeks ago

Description of the feature request:

allow to specify appid and signature.

What problem are you trying to solve with this feature?

I setup an api key restricted to an application. if I use generative-ai-js , I get:

{
  status: 403,
  statusText: 'Forbidden',
  errorDetails: [
    {
      '@type': 'type.googleapis.com/google.rpc.ErrorInfo',
      reason: 'API_KEY_ANDROID_APP_BLOCKED',
      domain: 'googleapis.com',
      metadata: {
        consumer: 'projects/xxxxxxxxx',
        service: 'generativelanguage.googleapis.com'
      }
    }
  ]
}

How do I specify the app id and signature?

Any other information you'd like to share?

No response

hsubox76 commented 1 week ago

This would be controlled by the backend service and not the SDK. I'd suggest posting in the discussion forum to try to reach some of the folks who are able to make changes to the service: https://discuss.ai.google.dev/