function sampleCreateTenant(projectId, externalId) {
  const client = new talent.TenantServiceClient();
  // const projectId = 'Your Google Cloud Project ID';
  // const externalId = 'Your Unique Identifier for Tenant';
  const formattedParent = client.projectPath(projectId);
  const tenant = {
    externalId: externalId,
  };
  const request = {
    parent: formattedParent,
    tenant: tenant,
  };
  client
    .createTenant(request)
    .then(responses => {
      const response = responses[0];
      console.log('Created Tenant');
      console.log(`Name: ${response.name}`);
      console.log(`External ID: ${response.externalId}`);
    })
    .catch(err => {
      console.error(err);
    });
}
Create Tenant for scoping resources, e.g. companies and jobs