Skip to content

maxint-app/appstore-connect-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppStore Connect API SDK

Go SDK for the Apple App Store Connect API, generated from the App Store Connect OpenAPI schema (version 4.3).

This package provides typed request/response models and a generated HTTP client for App Store Connect endpoints across API versions (v1/v2/v3).

Important Links

Installation

go get github.com/maxint-app/appstore-connect-sdk

Import:

import appstore_connect_sdk "github.com/maxint-app/appstore-connect-sdk"

Authentication

App Store Connect API uses a Bearer token (JWT) signed with ES256.

This SDK does not generate JWT tokens for you; provide a token via a request editor:

func bearerTokenEditor(token string) appstore_connect_sdk.RequestEditorFn {
	return func(ctx context.Context, req *http.Request) error {
		req.Header.Set("Authorization", "Bearer "+token)
		return nil
	}
}

See Apple docs for JWT details and required claims.

Quick Start

The default server URL from the schema is:

https://api.appstoreconnect.apple.com/

Create a typed client and call an endpoint:

package main

import (
	"context"
	"fmt"
	"log"
	"net/http"

	appstore_connect_sdk "github.com/maxint-app/appstore-connect-sdk"
)

func bearerTokenEditor(token string) appstore_connect_sdk.RequestEditorFn {
	return func(ctx context.Context, req *http.Request) error {
		req.Header.Set("Authorization", "Bearer "+token)
		return nil
	}
}

func main() {
	token := "<YOUR_APP_STORE_CONNECT_JWT>"

	client, err := appstore_connect_sdk.NewClientWithResponses(
		"https://api.appstoreconnect.apple.com",
		appstore_connect_sdk.WithRequestEditorFn(bearerTokenEditor(token)),
	)
	if err != nil {
		log.Fatalf("create client: %v", err)
	}

	resp, err := client.AppsGetCollectionWithResponse(context.Background(), nil)
	if err != nil {
		log.Fatalf("apps get collection: %v", err)
	}

	if resp.JSON200 != nil {
		fmt.Printf("fetched %d app(s)\n", len(resp.JSON200.Data))
		return
	}

	if resp.JSON401 != nil {
		log.Fatalf("unauthorized: check JWT generation and expiration")
	}

	log.Fatalf("unexpected status: %s", resp.HTTPResponse.Status)
}

Raw Client Option

You can also use the non-typed client (NewClient) if you want raw *http.Response handling.

Regenerating the SDK

This repository includes generation config in cfg.yaml.

Generate with Make:

make generate-sdk

Equivalent command:

oapi-codegen -config cfg.yaml ./openapi.oas.json

If needed, install oapi-codegen first:

go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest

License

This project is intended to use the Mozilla Public License 2.0 (MPL-2.0).

© Maxint Inc. 2026

About

Go SDK for the Apple App Store Connect API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors