Shared SDK Client
Bootstrap one Gwop client and keep identity request options separate
Start with one shared Gwop client for your backend. Do not create ad hoc SDK instances inside routes or services.
Why this pattern
- merchant API key, webhook secret, and timeout are app-level configuration
- invoices and webhook verification use the same client instance
- auth intents, sessions, and JWKS still need identity-specific request options
That split is the important nuance: one SDK client, plus explicit request options for the identity surface.
Recommended shape
What to carry into your own app
- create the SDK once at startup
- inject it into your adapters or services
- keep identity request options as a small explicit helper
- avoid hardcoding the identity hostname deep inside auth code