Nexus SDK¶
The Nexus SDK is the lightweight Go client used by your application's Control Plane logic to manage user connections.
Core Features¶
- Connection Management: Start handshakes and check status.
- Token Retrieval: Fetch the current Strategy and Credentials.
- Automatic Retries: Built-in exponential backoff for Gateway calls.
- Polling Helpers:
WaitForActivesimplifies the "waiting for user consent" flow.
Common Operations¶
Initialize Client¶
Request a Connection¶
resp, err := client.RequestConnection(ctx, nexus.RequestConnectionInput{
UserID: "user-1",
ProviderName: "google",
Scopes: []string{"email", "profile"},
ReturnURL: "https://my-app.com/callback",
})
Wait for User Consent¶
// Polls the gateway until the user completes the flow or the context expires
status, err := client.WaitForActive(ctx, connectionID, 2 * time.Second)