Documentation
¶
Overview ¶
Package tink is the public entrypoint for the Tink Open Banking SDK for Go.
Domain-Driven Design structure ¶
The SDK is organised into three explicit layers:
- domain/ — Pure value objects and error types. Zero I/O, zero external deps.
- application/ — Use-case services. Each subdirectory is one bounded context.
- infrastructure/ — HTTP transport, LRU cache, retry, rate limiting.
Quick start ¶
client := tink.New(tink.Config{
ClientID: os.Getenv("TINK_CLIENT_ID"),
ClientSecret: os.Getenv("TINK_CLIENT_SECRET"),
})
// 1. Acquire an app-level token.
token, err := client.Auth.ClientCredentials(ctx, "accounts:read,transactions:read")
if err != nil { log.Fatal(err) }
// 2. Create an authorization grant code for an end user.
grant, err := client.Auth.CreateAuthorizationGrant(ctx, token.AccessToken,
auth.CreateAuthorizationGrantParams{
ExternalUserID: "user-123",
Scope: "accounts:read,transactions:read",
})
// 3. Build the Tink Link URL and redirect the user.
linkURL := client.Connectivity.BuildTransactionsLink(grant.Code,
connectivity.LinkURLOptions{
Market: "GB",
Locale: "en_US",
RedirectURI: "https://yourapp.com/tink/callback",
})
// 4. After callback, exchange the code for a user token, then fetch accounts.
userToken, _ := client.Auth.ExchangeCode(ctx, auth.AuthorizationCodeParams{Code: callbackCode})
accounts, _ := client.Accounts.ListAll(ctx, userToken.AccessToken)
Error handling ¶
var te *errors.TinkError
if goerrors.As(err, &te) {
fmt.Println(te.StatusCode, te.Type, te.Retryable())
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// Auth provides OAuth 2.0 token flows and authorization grant operations.
Auth *appauth.Service
// Accounts provides bank account, credential, identity, investment, and loan access.
Accounts *appaccount.Service
// Transactions provides transaction listing, enrichment, categories, and statistics.
Transactions *apptxn.Service
// Providers provides financial institution reference data.
Providers *appprovider.Service
// Verification provides account check, balance check, and risk-insights flows.
Verification *appverif.Service
// Finance provides budgets, cash flow, and financial calendar management.
Finance *appfinance.Service
// Connectivity provides provider health monitoring, Connector ingestion, and Link URL building.
Connectivity *appconn.Service
// Webhooks provides HMAC signature verification and event dispatch.
Webhooks *appwebhook.Service
}
Client is the top-level Tink SDK client. Each field is the application service for its bounded context. Construct via New; the zero value is not usable.
All services share a single underlying HTTP client and are safe for concurrent use by multiple goroutines.
type Config ¶
type Config struct {
// ClientID is your Tink application's client_id (required).
ClientID string
// ClientSecret is your Tink application's client_secret (required).
ClientSecret string
// WebhookSecret is the HMAC-SHA256 secret for verifying incoming webhook payloads.
WebhookSecret string
// BaseURL overrides the Tink API base URL. Defaults to https://api.tink.com.
BaseURL string
// Timeout is the per-request HTTP deadline. Defaults to 30s.
Timeout time.Duration
// MaxRetries is the maximum number of retry attempts on transient errors. Defaults to 3.
MaxRetries int
// CacheMaxSize caps the in-memory response cache. Defaults to 512 entries.
CacheMaxSize int
// CacheEnabled enables GET-response caching. Defaults to false.
CacheEnabled bool
}
Config holds the SDK configuration. ClientID and ClientSecret are required; all other fields have defaults.
Directories
¶
| Path | Synopsis |
|---|---|
|
application
|
|
|
account
Package account provides the Account application service for the Tink Open Banking SDK.
|
Package account provides the Account application service for the Tink Open Banking SDK. |
|
auth
Package auth provides the Auth application service for the Tink Open Banking SDK.
|
Package auth provides the Auth application service for the Tink Open Banking SDK. |
|
connectivity
Package connectivity provides the Connectivity application service for the Tink Open Banking SDK.
|
Package connectivity provides the Connectivity application service for the Tink Open Banking SDK. |
|
finance
Package finance provides the Finance application service for the Tink Open Banking SDK.
|
Package finance provides the Finance application service for the Tink Open Banking SDK. |
|
provider
Package provider provides the Provider application service for the Tink Open Banking SDK.
|
Package provider provides the Provider application service for the Tink Open Banking SDK. |
|
transaction
Package transaction provides the Transaction application service for the Tink Open Banking SDK.
|
Package transaction provides the Transaction application service for the Tink Open Banking SDK. |
|
verification
Package verification provides the Verification application service for the Tink Open Banking SDK.
|
Package verification provides the Verification application service for the Tink Open Banking SDK. |
|
webhook
Package webhook provides the Webhook application service for the Tink Open Banking SDK.
|
Package webhook provides the Webhook application service for the Tink Open Banking SDK. |
|
domain
|
|
|
account
Package account defines the Account domain aggregate for the Tink Open Banking SDK.
|
Package account defines the Account domain aggregate for the Tink Open Banking SDK. |
|
auth
Package auth defines the Auth domain aggregate for the Tink Open Banking SDK.
|
Package auth defines the Auth domain aggregate for the Tink Open Banking SDK. |
|
connectivity
Package connectivity defines the Connectivity domain aggregate for the Tink Open Banking SDK.
|
Package connectivity defines the Connectivity domain aggregate for the Tink Open Banking SDK. |
|
errors
Package errors defines the TinkError value object for the Tink Open Banking SDK.
|
Package errors defines the TinkError value object for the Tink Open Banking SDK. |
|
finance
Package finance defines the Finance Management domain aggregate for the Tink Open Banking SDK.
|
Package finance defines the Finance Management domain aggregate for the Tink Open Banking SDK. |
|
provider
Package provider defines the Provider domain aggregate for the Tink Open Banking SDK.
|
Package provider defines the Provider domain aggregate for the Tink Open Banking SDK. |
|
transaction
Package transaction defines the Transaction domain aggregate for the Tink Open Banking SDK.
|
Package transaction defines the Transaction domain aggregate for the Tink Open Banking SDK. |
|
verification
Package verification defines the Verification domain aggregate for the Tink Open Banking SDK.
|
Package verification defines the Verification domain aggregate for the Tink Open Banking SDK. |
|
webhook
Package webhook defines the Webhook domain aggregate for the Tink Open Banking SDK.
|
Package webhook defines the Webhook domain aggregate for the Tink Open Banking SDK. |
|
examples
|
|
|
quickstart
command
Package main is a self-contained quickstart example for the Tink Go SDK.
|
Package main is a self-contained quickstart example for the Tink Go SDK. |
|
infrastructure
|
|
|
cache
Package cache provides a concurrency-safe, fixed-size LRU cache with per-entry TTLs.
|
Package cache provides a concurrency-safe, fixed-size LRU cache with per-entry TTLs. |
|
http
Package http provides the low-level HTTP transport adapter for the Tink SDK.
|
Package http provides the low-level HTTP transport adapter for the Tink SDK. |
|
ratelimit
Package ratelimit provides a concurrency-safe token-bucket rate limiter.
|
Package ratelimit provides a concurrency-safe token-bucket rate limiter. |
|
retry
Package retry provides exponential-backoff retry logic for the Tink HTTP client.
|
Package retry provides exponential-backoff retry logic for the Tink HTTP client. |
Click to show internal directories.
Click to hide internal directories.