---
title: 'Sharing and users'
url: 'https://docs.geens.com/geens-partners/geens-sdk/browser-sdk/sharing-and-users'
markdown: 'https://docs.geens.com/geens-partners/geens-sdk/browser-sdk/sharing-and-users.md'
date: '2026-12-03'
description: "Generate or update a shareable link The method name is generateSharableUrlLinks. For a new link, provide item IDs, a password of at least eight characters, permissions, an identity type, and null for the existing URL token: sdk.generateSharableUrlLinks([123], 'share-password', 4, 5, null, onSucces…"
---

# Sharing and users

[](#)# Sharing and users

## Generate or update a shareable link

The method name is `generateSharableUrlLinks`. For a new link, provide item IDs, a password of at least eight characters, permissions, an identity type, and `null` for the existing URL token:

```javascript
sdk.generateSharableUrlLinks([123], 'share-password', 4, 5, null, onSuccess, onError);
```

For an existing link, pass its URL token and an empty ID array. Supply a new password to change it, or `''` to leave it unchanged:

```javascript
sdk.generateSharableUrlLinks([], '', 4, 5, 'existing-url-token', onSuccess, onError);
```

| Permission | Access |
|---|---|
| `4` | Download |
| `5` | View |
| `6` | Upload |
| `7` | View and edit |
| `8` | Download, view, and upload |
| `9` | Download, view, and edit |
| `10` | Upload and view |
| `11` | Upload, edit, and view |
| `12` | Upload, download, edit, and view |

Identity type `5` identifies recipients by Geens ID; `6` uses their surname. The success callback receives the API's link response.

## Read or revoke a shared link

```javascript
sdk.getSharedUrl(123, {
  url_token: 'existing-url-token',
  password: 'share-password'
}, onSuccess, onError);

sdk.revokeUrlShare('existing-url-token', onSuccess, onError);
```

`getSharedUrl` accepts a folder/item ID and returns decrypted items. Its optional `external_access_token` field is an array of strings.

## Look up users

Geens IDs include a `#` separator, such as `person#organization`.

```javascript
sdk.checkGeensIds(['person#organization'], onSuccess, onError);
sdk.getUsersByUids(['user-uid'], onSuccess, onError);
```

## Share an item with users or revoke access

For direct user shares, permission `3` is read/write and `4` is download access. Use the share's access ID when revoking it, rather than the item ID.

```javascript
sdk.createItemShareForUsers(123, ['person#organization'], 3, onSuccess, onError);
sdk.revokeSharedItemAccess(456, onSuccess, onError);
```

## User data and permissions

`getUserData` refreshes the SDK's locally stored user data. Its success callback signals completion; it is not a general-purpose user-profile return value.

```javascript
sdk.getUserData(onSuccess, onError);

const permissions = sdk.geensGroupUserPermissionsList;
const canCreateItems = sdk.checkIfUserHasPermission([permissions.ITEM_CREATE]);
```

`checkIfUserHasPermission` throws if no local user data is available. Passing multiple permissions checks whether the user has any of them, subject to the SDK's administrator and personal-account rules. Geens still enforces access on the server.

---

## Navigation

- Parent: [Browser SDK](https://docs.geens.com/geens-partners/geens-sdk/browser-sdk.md)
- Previous: [Files and directories](https://docs.geens.com/geens-partners/geens-sdk/browser-sdk/files-and-directories.md)
- Next: [Text encryption and random tokens](https://docs.geens.com/geens-partners/geens-sdk/browser-sdk/text-encryption-and-random-tokens.md)
