Just in case other people run into this:
I was getting 403's when I implemented the solution in this blog. It turns out that my company uses a different datadog enpoint than the default. So if you're using a different one, here's how to configure it:
const configuration = client.createConfiguration({
authMethods: {
apiKeyAuth: "pub...",
},
});
configuration.setServerVariables({
site: "us5.datadoghq.com"
});
const apiInstance = new v2.LogsApi(configuration);