<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CloudKitJS",
  "identifier" : "/documentation/CloudKitJS/CloudKit.Container/whenUserSignsOut",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit JS"
    ],
    "preciseIdentifier" : "instm/CloudKit.Container/whenUserSignsOut"
  },
  "title" : "whenUserSignsOut"
}
-->

# whenUserSignsOut

Returns an object representing a deferred or asynchronous operation that resolves when the user signs out.

```
Promise<Undefined, CloudKit.CKError> whenUserSignsOut();
```

## Return Value

A `Promise` object that resolves to `Undefined` when the user signs out, or rejects to a [`CKError`](/documentation/CloudKitJS/CloudKit/CKError) object.

## Discussion

Use the [`whenUserSignsOut`](/documentation/CloudKitJS/CloudKit.Container/whenUserSignsOut) method to call a function when the user signs out.

```javascript
myContainer.whenUserSignsOut().then(function() {
    // The user signed out
});
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)