## Get Beeper app setup state

`client.App.Setup.Get(ctx) (*AppSetupGetResponse, error)`

**get** `/v1/app/setup`

Return the current Beeper Desktop or Beeper Server sign-in and encrypted messaging setup state. This endpoint is public before sign-in so apps can discover that sign-in is needed; after sign-in, pass a read token.

### Returns

- `type AppSetupGetResponse struct{…}`

  - `E2EE AppSetupGetResponseE2EE`

    Encrypted messaging setup status.

    - `CrossSigning bool`

      Whether this account can verify trusted devices.

    - `FirstSyncDone bool`

      Whether the first encrypted message sync is complete.

    - `HasBackedUpRecoveryKey bool`

      Whether the user confirmed that they saved their recovery key.

    - `Initialized bool`

      Whether encrypted messaging setup has started.

    - `KeyBackup bool`

      Whether encrypted message backup is available.

    - `Secrets AppSetupGetResponseE2EESecrets`

      Encrypted messaging keys available on this device.

      - `MasterKey bool`

        Whether the account identity key is available.

      - `MegolmBackupKey bool`

        Whether the encrypted message backup key is available.

      - `RecoveryKey bool`

        Whether a recovery key is available.

      - `SelfSigningKey bool`

        Whether the device trust key is available.

      - `UserSigningKey bool`

        Whether the user trust key is available.

    - `SecretStorage bool`

      Whether secure key storage is available.

    - `Verified bool`

      Whether this device is trusted for encrypted messages.

    - `RecoveryKeyGeneratedAt float64`

      Unix timestamp for when the recovery key was created.

  - `State AppSetupGetResponseState`

    Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

    - `const AppSetupGetResponseStateNeedsLogin AppSetupGetResponseState = "needs-login"`

    - `const AppSetupGetResponseStateInitializing AppSetupGetResponseState = "initializing"`

    - `const AppSetupGetResponseStateNeedsCrossSigningSetup AppSetupGetResponseState = "needs-cross-signing-setup"`

    - `const AppSetupGetResponseStateNeedsVerification AppSetupGetResponseState = "needs-verification"`

    - `const AppSetupGetResponseStateNeedsSecrets AppSetupGetResponseState = "needs-secrets"`

    - `const AppSetupGetResponseStateNeedsFirstSync AppSetupGetResponseState = "needs-first-sync"`

    - `const AppSetupGetResponseStateReady AppSetupGetResponseState = "ready"`

  - `Matrix AppSetupGetResponseMatrix`

    Signed-in account details. Omitted until sign-in is complete.

    - `DeviceID string`

      Current device ID.

    - `Homeserver string`

      Beeper homeserver URL for this account.

    - `UserID string`

      Signed-in Beeper user ID.

  - `Verification AppSetupGetResponseVerification`

    Trusted device verification progress.

    - `ID string`

      Verification ID to pass in verification action paths.

    - `AvailableActions []string`

      Verification actions that are valid for the current state.

      - `const AppSetupGetResponseVerificationAvailableActionAccept AppSetupGetResponseVerificationAvailableAction = "accept"`

      - `const AppSetupGetResponseVerificationAvailableActionCancel AppSetupGetResponseVerificationAvailableAction = "cancel"`

      - `const AppSetupGetResponseVerificationAvailableActionQRConfirmScanned AppSetupGetResponseVerificationAvailableAction = "qr.confirmScanned"`

      - `const AppSetupGetResponseVerificationAvailableActionSASStart AppSetupGetResponseVerificationAvailableAction = "sas.start"`

      - `const AppSetupGetResponseVerificationAvailableActionSASConfirm AppSetupGetResponseVerificationAvailableAction = "sas.confirm"`

    - `Direction string`

      Whether this device started or received the verification.

      - `const AppSetupGetResponseVerificationDirectionIncoming AppSetupGetResponseVerificationDirection = "incoming"`

      - `const AppSetupGetResponseVerificationDirectionOutgoing AppSetupGetResponseVerificationDirection = "outgoing"`

    - `Methods []string`

      Verification methods supported for this transaction.

      - `const AppSetupGetResponseVerificationMethodQR AppSetupGetResponseVerificationMethod = "qr"`

      - `const AppSetupGetResponseVerificationMethodSAS AppSetupGetResponseVerificationMethod = "sas"`

    - `Purpose string`

      Why this verification exists.

      - `const AppSetupGetResponseVerificationPurposeLogin AppSetupGetResponseVerificationPurpose = "login"`

      - `const AppSetupGetResponseVerificationPurposeDevice AppSetupGetResponseVerificationPurpose = "device"`

    - `State string`

      Current trusted-device verification state.

      - `const AppSetupGetResponseVerificationStateRequested AppSetupGetResponseVerificationState = "requested"`

      - `const AppSetupGetResponseVerificationStateReady AppSetupGetResponseVerificationState = "ready"`

      - `const AppSetupGetResponseVerificationStateSASReady AppSetupGetResponseVerificationState = "sas_ready"`

      - `const AppSetupGetResponseVerificationStateQRScanned AppSetupGetResponseVerificationState = "qr_scanned"`

      - `const AppSetupGetResponseVerificationStateDone AppSetupGetResponseVerificationState = "done"`

      - `const AppSetupGetResponseVerificationStateCancelled AppSetupGetResponseVerificationState = "cancelled"`

      - `const AppSetupGetResponseVerificationStateError AppSetupGetResponseVerificationState = "error"`

    - `Error AppSetupGetResponseVerificationError`

      Verification error details, if verification stopped.

      - `Code string`

        Verification error code.

      - `Reason string`

        User-facing verification error message.

    - `OtherDevice AppSetupGetResponseVerificationOtherDevice`

      Other device participating in verification.

      - `ID string`

        Other device ID.

      - `Name string`

        Other device display name, if known.

    - `OtherUserID string`

      Other Beeper user participating in verification.

    - `QR AppSetupGetResponseVerificationQR`

      QR verification data.

      - `Data string`

        QR code payload to display for verification.

    - `SAS AppSetupGetResponseVerificationSAS`

      Emoji or number comparison data for verification.

      - `Emojis string`

        Emoji sequence to compare on both devices.

      - `Decimals string`

        Number sequence to compare on both devices.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/beeper/desktop-api-go"
  "github.com/beeper/desktop-api-go/option"
)

func main() {
  client := beeperdesktopapi.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  setup, err := client.App.Setup.Get(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", setup.E2EE)
}
```

#### Response

```json
{
  "e2ee": {
    "crossSigning": true,
    "firstSyncDone": true,
    "hasBackedUpRecoveryKey": true,
    "initialized": true,
    "keyBackup": true,
    "secrets": {
      "masterKey": true,
      "megolmBackupKey": true,
      "recoveryKey": true,
      "selfSigningKey": true,
      "userSigningKey": true
    },
    "secretStorage": true,
    "verified": true,
    "recoveryKeyGeneratedAt": 0
  },
  "state": "needs-login",
  "matrix": {
    "deviceID": "deviceID",
    "homeserver": "homeserver",
    "userID": "userID"
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```
