0
Create Board
One script reply has been approved by the moderators Verified

Creates a new board.

Created by saskiaorient 1113 days ago Viewed 22447 times
0
Submitted by hugo697 Bun
Verified 623 days ago
1
import monday from "monday-sdk-js";
2

3
type Monday = {
4
  token: string;
5
};
6

7
export async function main(auth: Monday, boardName: string) {
8
  const mondayClient = monday();
9
  mondayClient.setToken(auth.token);
10
  const query = `mutation ($boardName: String!) {
11
        create_board (board_name: $boardName, board_kind: public) {
12
            id
13
        }
14
    }`;
15

16
  const variables = { boardName };
17

18
  return await mondayClient.api(query, { variables });
19
}
20