Skip to content

API Reference ​

Every method of skapi-swift 2.4.0. Skapi is an actor: each call is try await. Each one throws SkapiError on failure. What skapi-js has and this SDK leaves out is listed in Not Included.

Connection ​

method
Skapi(projectId:storage:timeout:targetCDN:encryption:urlSession:observeAppLifecycle:)connects to one project
getConnectionInfo(refresh:)project name and settings
appDidReturn()tells the SDK the app came back to the foreground
SkapiStorage, KeychainStorage, MemoryStorage, FileStoragewhere the session is kept
FetchOptionspaging
JSONthe value type of data, queries and answers
SkapiErrorthe error every method throws

Authentication ​

method
signup(_:option:)creates an account
resendSignupConfirmation()sends the confirmation e-mail again
login(email:username:password:)signs in
verifyMFA(code:)finishes a login that needs an authenticator code
logout(global:)signs out
getProfile(refreshToken:)the signed-in user's profile
loginWithToken(idToken:accessToken:refreshToken:)adopts tokens from another sign-in
updateProfile(_:)changes the user's profile
changePassword(currentPassword:newPassword:)changes the password
forgotPassword(email:template:)sends a password reset code
resetPassword(email:code:newPassword:)sets a new password with the code
verifyEmail(code:template:)sends or checks an e-mail verification code
lastVerifiedEmail(revert:)the last verified e-mail
disableAccount()disables the user's own account
recoverAccount(redirect:)sends the recovery e-mail to a disabled account
openIdLogin(token:id:merge:template:)signs in through an OpenID provider
anonymousLogin()a temporary account without e-mail or password
verifyAnonymousSession()checks a restored temporary account still exists
setupMFA(issuer:accountName:) / enableMFA(code:) / disableMFA() / getMFAStatus()two-step login with an authenticator app

Database ​

method
postRecord(_:config:files:)creates or updates a record
postRecords(_:)many records in few requests
getRecords(_:fetchOptions:)reads records
deleteRecords(_:fetchOptions:)deletes records
getTables / getTags / getIndexes / getUniqueIdwhat the database holds
uploadFiles(_:recordId:service:)attaches files to a record
getFile / getFileText / getFileEndpoint / getFileInfo / downloadFilereads a file, or makes a link to it
deleteFiles(_:)removes files from records
grantPrivateRecordAccess / removePrivateRecordAccess / listPrivateRecordAccess / requestPrivateRecordAccessKeysharing private records

Encryption ​

method
EncryptionOptionsturns encryption on, in Skapi(projectId:encryption:)
getEncryptionStatus()locked, unlocked or disabled
unlockEncryption(password:) / lockEncryption(forgetDevice:)opens or forgets the user's keys
unlockEncryptionWithRecoveryCode(_:password:) / regenerateEncryptionRecoveryCode()encryption recovery codes (the first one is shown once in getConnectionInfo())
pinPeerKey(userId:fingerprint:)trusts another user's key for sharing
isWithheld(_:)tells the placeholder of undecryptable data apart

Users ​

method
getUsers(_:fetchOptions:)searches the project's users
subscribe(_:) / unsubscribe(_:)subscribes to another user
blockSubscriber(_:) / unblockSubscriber(_:)blocks a subscriber
getSubscriptions(_:fetchOptions:)who subscribes to whom
getFeed(_:fetchOptions:)records from the users you subscribe to
subscribeNewsletter(_:) / unsubscribeNewsletter(group:)newsletter subscription
getNewsletters(_:fetchOptions:) / getNewsletterSubscription(_:fetchOptions:)sent newsletters and the user's subscriptions
sendInquiry(_:)sends a message to the project owner

Realtime ​

method
connectRealtime(_:) / closeRealtime()opens or closes the realtime connection
joinRealtime(group:)joins or leaves a group
postRealtime(_:recipient:notification:)sends to a user or to the group
getRealtimeGroups(_:fetchOptions:) / getRealtimeUsers(_:fetchOptions:)who is connected where
RealtimeEventwhat the callback receives

API Bridge ​

method
forwardRequest(_:form:multipart:onStream:)calls another API through Skapi, with your client secrets
forwardRequestPoll(_:poll:url:method:onStream:service:owner:) / forwardRequestStream(_:options:onStream:)waits for a queued or streamed answer
forwardRequestFinalize(_:data:options:)stores a streamed request's final answer
forwardRequestHistory(_:fetchOptions:)past forwarded requests and their answers
cancelForwardRequest(_:) / forwardRequestQueueCount(_:)queue control
FormPartone part of a multipart body

Tickets ​

method
consumeTicket(ticketId:method:data:auth:)calls a ticket
getTickets(_:fetchOptions:)the project's tickets
getConsumedTickets(_:fetchOptions:)the user's own ticket calls

skapi-swift 2.4.0