From 53fd74385128efa8709e96b0e28b3e43ac0a9ff4 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Sun, 15 Mar 2026 20:06:13 +0100 Subject: [PATCH 1/2] docs: msgCaller and canisterSelf Signed-off-by: David Dal Busco --- .../reference/functions/typescript/ic-cdk.mdx | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/reference/functions/typescript/ic-cdk.mdx b/docs/reference/functions/typescript/ic-cdk.mdx index dba1c29b..515574cf 100644 --- a/docs/reference/functions/typescript/ic-cdk.mdx +++ b/docs/reference/functions/typescript/ic-cdk.mdx @@ -28,14 +28,14 @@ You have to follow the pace of the Juno release to ensure compatibility. Refer t --- -## id +## canisterSelf Retrieves the Principal ID of the current Satellite. This is useful when you want to use functions such as [setDocStore](./sdk.mdx#setdocstore) with the caller set as the administrator. Since the code is running on the backend side (inside the container), the Satellite itself is considered the caller and has admin-level permissions. ```typescript -function id(): Principal; +function canisterSelf(): Principal; ``` 📦 Import from `@junobuild/functions/ic-cdk` @@ -47,6 +47,7 @@ function id(): Principal; #### Notes: - This function is a JavaScript binding for the Rust function [ic_cdk::id()](https://docs.rs/ic-cdk/latest/ic_cdk/fn.id.html). +- It was previously named `id()` and is also accessible as `satelliteSelf()`. --- @@ -80,6 +81,28 @@ function call(params: CallParams): Promise; --- +## msgCaller + +Returns the Principal ID of the caller of the current function. + +```typescript +function msgCaller(): Principal; +``` + +📦 Import from `@junobuild/functions/ic-cdk` + +#### Returns: + +- `Principal`: The Principal ID of the caller. + +#### Notes: + +- This function is a JavaScript binding for the Rust function [ic_cdk::api::msg_caller()](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.msg_caller.html). +- In serverless hooks, the caller is the Satellite itself. The end user's Principal can be retrieved from the payload instead. +- This function was previously named `caller()`. + +--- + ## time Returns the current timestamp in nanoseconds since the Unix epoch. From 33064d97dbda7243913aa0b700ba579b37c78810 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 15 Mar 2026 19:07:55 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index 216f5624..cfac712d 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -11462,14 +11462,14 @@ You have to follow the pace of the Juno release to ensure compatibility. Refer t --- -## id +## canisterSelf Retrieves the Principal ID of the current Satellite. This is useful when you want to use functions such as [setDocStore](/docs/reference/functions/typescript/sdk.md#setdocstore) with the caller set as the administrator. Since the code is running on the backend side (inside the container), the Satellite itself is considered the caller and has admin-level permissions. ``` -function id(): Principal; +function canisterSelf(): Principal; ``` 📦 Import from `@junobuild/functions/ic-cdk` @@ -11481,6 +11481,7 @@ function id(): Principal; #### Notes: * This function is a JavaScript binding for the Rust function [ic\_cdk::id()](https://docs.rs/ic-cdk/latest/ic_cdk/fn.id.html). +* It was previously named `id()` and is also accessible as `satelliteSelf()`. --- @@ -11514,6 +11515,28 @@ function call(params: CallParams): Promise; --- +## msgCaller + +Returns the Principal ID of the caller of the current function. + +``` +function msgCaller(): Principal; +``` + +📦 Import from `@junobuild/functions/ic-cdk` + +#### Returns: + +* `Principal`: The Principal ID of the caller. + +#### Notes: + +* This function is a JavaScript binding for the Rust function [ic\_cdk::api::msg\_caller()](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.msg_caller.html). +* In serverless hooks, the caller is the Satellite itself. The end user's Principal can be retrieved from the payload instead. +* This function was previously named `caller()`. + +--- + ## time Returns the current timestamp in nanoseconds since the Unix epoch.