# ]

###
```

## Important: when using the Viewer SDK, use the latest values:
```
env: 'AutodeskProduction'
api: 'streamingV2'
```
Do not use `api: 'derivativeV2'` - it is deprecated and old.

## When retrieving a models's URN from ACC via items (or BIM360 Hubs), use their tip version, like this .mjs sample code:

```
const getFolderContents = async (projectId, folderUrn, token) => {
  const encodedFolderUrn = encodeURIComponent(folderUrn);
  const response = await fetch(
    `${APS_BASE_URL}/data/v1/projects/${projectId}/folders/${encodedFolderUrn}/contents`,
    {
      headers: {
        'Authorization': `Bearer ${token}`,
      }
    }
  );
  
  return await response.json();
};

const getTipVersion = async (projectId, itemId, token) => {
  const response = await fetch(
    `${APS_BASE_URL}/data/v1/projects/${projectId}/items/${itemId}/tip`,
    {
      headers: {
        'Authorization': `Bearer ${token}`,
      }
    }
  );
  
  return await response.json();
};

export const getModels = async (url) => {
  const tokenResponse = await getToken();
  const token = tokenResponse.access_token;
  
  const { projectId, folderUrn } = parseAccUrl(url);
  
  const folderContents = await getFolderContents(projectId, folderUrn, token);
  
  const models = [];
  
  for (const item of folderContents.data || []) {
    if (item.type === 'items') {
      const tipData = await getTipVersion(projectId, item.id, token);
      
      models.push({
        name: item.attributes.displayName,
        urn: tipData?.data?.relationships?.derivatives?.data?.id
      });
    }
  }
  
  return models;
};
```