translatePath

Fetch info about a Drupal path.


const path = await drupal.translatePath(
path,
options?: {
withAuth,
}
): Promise<DrupalTranslatedPath | null>
  • path: string
    • Required
    • The resource path. Example: /blog/slug-for-article.
  • options
    • Optional
    • withAuth: boolean | NextDrupalAuth:
      • Set the authentication method to use. See the authentication docs.
      • Set to true to use the authentication method configured on the client.

Notes


Examples

  • Get info about a /blog/slug-for-article path.
const path = await drupal.translatePath("/blog/slug-for-article")