To generate a DataHub access token, go to Settings → Access Tokens → Create. Set the Role to "Maintainer" and select the Scopes: "read_repository" and "write_repository."
The access token will be displayed only once, so make sure to store it securely. Treat it like a password, as anyone with the token can access and modify the DataHUB repo.
A detailed user guide can be found
here