I just tested this on my side and both the property and its methods work as expected.
@tank666 Thanks for the response, can you please confirm some details for me?
Here’s my setup:
1) Figma project - Library Source
- this project contains a single variable collection: “Collection 1” and a single color variable “test” set to #ffffff (not that the color matters).
- I published this as a library to one of my enterprise subscription teams, including “test” variable as an export
2) Figma project - Library Test
- I imported “Library Source” project as an asset library, create a rectangle node and assign the fill property to the “test” variable from “Library Source”
Next I created a basic, run-once plugin with the following manifest:
{
"name": "library-variables",
"id": "1256735375235080757",
"api": "1.0.0",
"main": "code.js",
"capabilities": ,],
"enableProposedApi": false,
"permissions": e"teamlibrary"],
"editorType": "
"figma"
],
"networkAccess": {
"allowedDomains":
"none"
]
}
}
And this in the code.js file:
console.clear();
console.log(figma.teamLibrary);
figma.closePlugin();
Running the plugin, the console output remains: undefined and I cannot access teamLibrary from within the plugin.
If I run this in the console window directly: console.log(figma.teamLibrary) then I get this result:
{getAvailableLibraryVariableCollectionsAsync: ƒ, getVariablesInLibraryCollectionAsync: ƒ}
Not sure why the plugin isn’t returning the same object reference.
So the difference between your manifest file and mine is that I had the proposed API enabled.
Thank you, @tank666 , that was the trick.