JWT
public struct JWT : Sendable
A JSON Web Token (JWT) to be used to authorize API requests.
The JWT is valid for 20 minutes, but will be renewed automatically when performing requests with BagbutikService.
Full documentation for how JWT is used with the API: https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests
-
A value telling if the JWT has expired.
Declaration
Swift
public var isExpired: Bool { get } -
The signature to use in the authorization header when performing requests.
Declaration
Swift
public private(set) var encodedSignature: String { get } -
Create a JWT for a Team key.
Full documentation for how to get the required keys. https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api
Declaration
Swift
public init(keyId: String, issuerId: String, privateKey: String) throwsParameters
keyIdYour private key ID from App Store Connect; for example 2X9R4HXF34.
issuerIdYour issuer ID from the API Keys page in App Store Connect; for example, 57246542-96fe-1a63-e053-0824d011072a.
privateKeyThe contents of your private key from App Store Connect. Starting with
-----BEGIN PRIVATE KEY-----. -
Create a JWT for a Team key.
Full documentation for how to get the required keys. https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api
Declaration
Swift
public init(keyId: String, issuerId: String, privateKeyPath: String) throwsParameters
keyIdYour private key ID from App Store Connect; for example 2X9R4HXF34.
issuerIdYour issuer ID from the API Keys page in App Store Connect; for example, 57246542-96fe-1a63-e053-0824d011072a.
privateKeyPathThe file path to your private key from App Store Connect.
-
Create a JWT for an Individual key.
Full documentation for how to get the required keys. https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api
Declaration
Swift
public init(keyId: String, privateKey: String) throwsParameters
keyIdYour private key ID from App Store Connect; for example 2X9R4HXF34.
privateKeyThe contents of your private key from App Store Connect. Starting with
-----BEGIN PRIVATE KEY-----. -
Create a JWT for an Individual key.
Full documentation for how to get the required keys. https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api
Declaration
Swift
public init(keyId: String, privateKeyPath: String) throwsParameters
keyIdYour private key ID from App Store Connect; for example 2X9R4HXF34.
privateKeyPathThe file path to your private key from App Store Connect.
View on GitHub