Installation¶
Prerequisites¶
- A Google Apps Script project.
- Permission to add libraries in that project.
- Access to required Google services (Sheets/Drive/BigQuery) based on your usage.
Add as library¶
- Open your Apps Script project.
- Open Libraries.
- Add script ID:
- Choose a published version.
- Set an identifier.
Recommended identifier: ASTLib
ASTLib is the Apps Script library identifier. ASTX is a local alias used in code examples.
Normalize namespace once¶
Use this pattern at the top of scripts to support both direct and nested export shapes:
If you set identifier AST, the same pattern works:
Verify install¶
function verifyAstInstall() {
const ASTX = ASTLib.AST || ASTLib;
Logger.log({
version: ASTX.VERSION,
hasDataFrame: typeof ASTX.DataFrame === 'function',
hasSeries: typeof ASTX.Series === 'function',
hasUtils: !!ASTX.Utils,
hasAi: !!ASTX.AI,
hasRag: !!ASTX.RAG
});
}
OAuth scope notes¶
Library manifest scopes are declared in the library project. Your consumer script still needs to authorize at runtime when calling methods that touch external services.
Common scope-dependent surfaces:
ASTX.DataFrame.toSheet(...)and sheet open helpers.ASTX.Drive.read(...)andASTX.Drive.create(...).ASTX.Sql.run(...)with providerbigquery.ASTX.AI.*(...)for provider API requests (external request scope required).ASTX.AI.*(...)withprovider='vertex_gemini'(cloud-platform scope required).ASTX.RAG.*(...)for Drive ingestion/retrieval and embedding/generation provider calls.