0
List Users
One script reply has been approved by the moderators Verified
Created by adam186 381 days ago Viewed 5378 times
0
Submitted by adam186 Deno
Verified 381 days ago
1
import { Client, Users } from "https://deno.land/x/appwrite@7.0.0/mod.ts";
2

3
/**
4
 * @param queries Array of query strings. Learn more about queries here:
5
 * https://appwrite.io/docs/queries
6
 *
7
 * @param search Search term to filter your list results.
8
 */
9
type Appwrite = {
10
  endpoint: string;
11
  project: string;
12
  key: string;
13
  self_signed: boolean;
14
};
15
export async function main(
16
  auth: Appwrite,
17
  queries?: string[],
18
  search?: string,
19
) {
20
  const client = new Client()
21
    .setEndpoint(auth.endpoint)
22
    .setProject(auth.project)
23
    .setKey(auth.key);
24
  const users = new Users(client);
25

26
  return await users.list(queries, search);
27
}
28