Skip to main content
Version: v2

Publishing on a Different GCP project

/pubsub/topics/example-topic-with-custom-credentials.ts
export default class ExampleTopic extends Topic {
static readonly topicName = 'example-topic-with-custom-credentials';
static project: GooglePubSubProject = {
id: 'custom-project-id',
credentials: {
// eslint-disable-next-line
client_email: 'client@google-auth.google.com',
// eslint-disable-next-line
private_key: 'private_key_goes_here'
},
};
}