You need to create a Slack app and then connect it to your workspace to get slack webhooks. You do not need to have a paid workspace for this.
First you have to create a Slack app and then enter your CustomJS Function URL under "Request URL" under "Event Subscriptions"
To do this, your function must contain at least this code so that Slack can test it.
return input.challenge;
Depending on whether you want to interact on behalf of the user with whom you connect the app to your workspace or whether the app acts as a bot itself, you have to set scopes.
Now you can copy the token and insert it as a variable in the code stored within CustomJS. You then act either as an app bot or as the user with whom you installed your app.
Learn how to send a welcome message to every new Slack user:
CustomJS Slack Bot Example