Skip to main content
Version: v1

Publishing on a Different GCP project

/pubsub/topics/example-topic-with-customCredentials.ts
export default class ExampleTopic extends Topic {
public readonly name = 'example-topic-with-customCredentials';
public 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'
},
};
}